aboutsummaryrefslogtreecommitdiffstats
path: root/alv-lib/math.moon
diff options
context:
space:
mode:
authors-ol <s+removethis@s-ol.nu>2025-03-18 11:47:22 +0000
committers-ol <s+removethis@s-ol.nu>2025-03-18 12:06:18 +0000
commitb6cbc69461dc054019f50f8971704f6ef9de63ab (patch)
treed2b8942b780f668ccbe57b52dd8d65f61613e935 /alv-lib/math.moon
parentbuiltins: switch takes single array as value (diff)
downloadalive-wip.tar.gz
alive-wip.zip
language: [array] and {struct} literalswip
Diffstat (limited to 'alv-lib/math.moon')
-rw-r--r--alv-lib/math.moon4
1 files changed, 2 insertions, 2 deletions
diff --git a/alv-lib/math.moon b/alv-lib/math.moon
index 33f215c..2cf6e26 100644
--- a/alv-lib/math.moon
+++ b/alv-lib/math.moon
@@ -291,13 +291,13 @@ also work componentwise with vectors (`num[X]`) and matrices (`num[X][Y]`).
All operators are PureOps.
(+ 1 2 3) #(<num= 6>)
- (+ (array 1 2) (array 3 4)) #(<num[2]= [4 6]>)
+ (+ [1 2] [3 4]) #(<num[2]= [4 6]>)
The arguments for an operator generally have to be of the same type.
However it is also okay to pass in scalar numbers together with a different type.
The scalars will be repeated as necessary to fit the shape of other arguments:
- (* (array (array 1 2) (array 3 4))
+ (* [[1 2] [3 4]]
2)
#(<num[2][2]= [[2 4] [6 8]]>)