File tree 3 files changed +5
-5
lines changed
3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
(* ) # -> 1
2
2
(* 10 ) # -> 10
3
3
(* 10 20 ) # -> 200
4
- (* 1 2 3 4 5 6 7 ) # -> 5040
4
+ (* 1 2 3 4 5 6 7 ) # -> 5040
5
5
6
6
# Can take product of array with splice, but 'product' is better
7
- (* ;(range 1 20 )) # -> 1.21645e +17
8
- (product (range 1 20 )) # -> 1.21645e +17
7
+ (* ;(range 1 20 )) # -> 1.21645100408832e +17
8
+ (product (range 1 20 )) # -> 1.21645100408832e +17
Original file line number Diff line number Diff line change 1
1
(apply + (range 10 )) # -> 45
2
2
(apply + []) # -> 0
3
3
(apply + 1 2 3 4 5 6 7 [8 9 10 ]) # -> 55
4
- (apply + 1 2 3 4 5 6 7 8 9 10 ) # -> error: expected array| tuple, got number
4
+ (apply + 1 2 3 4 5 6 7 8 9 10 ) # -> error: expected array or tuple, got 10
5
5
6
6
# Can also be used to call macros like functions.
7
7
# Will return the macro expanded code of the original macro.
Original file line number Diff line number Diff line change 4
4
(product (range 1 10 )) # -> 362880
5
5
6
6
# Product over byte values [0-255] in a string
7
- (product " hello" ) # -> 1.35996e+10
7
+ (product " hello" ) # -> 13599570816
8
8
9
9
# Product over values in a table or struct
10
10
(product {:a 1 :b 2 :c 4 }) # -> 8
You can’t perform that action at this time.
0 commit comments