Time for an 2014 update…

This commit is contained in:
Ingy döt Net 2014-01-17 05:32:22 +00:00
parent 372c577f83
commit 09687c4926
2520 changed files with 34227 additions and 7318 deletions

View file

@ -0,0 +1,8 @@
!. map @++ [ 1 4 8 ]
#implemented roughly like this:
#map f lst:
# ]
# for i in lst:
# f i
# [

View file

@ -1,7 +1,7 @@
#define system.
#symbol PrintSecondPower =
&&:n [ console writeLine:(n * n) ].
(:n) [ console writeLine:(n * n) ].
#symbol program =
[

View file

@ -7,6 +7,10 @@ a;
# [ 1, 4, 9, 16 ]
# Apply and don't change values
List(b, n -> n*n);
# [ 1, 4, 9, 16 ]
# Apply and don't return anything (only side effects)
Perform(b, Display);
1
2

View file

@ -17,6 +17,6 @@ end
squares3 = [n * n for n in numbers] # no need for a function,
squares4 = numbers .* numbers #element-wise operation
squares4 = numbers .* numbers # element-wise operation
squares4a = numbers .^ 2 #includes .+, .-, ./, comparison, and bitwise operations as well
squares4a = numbers .^ 2 # most arithmetic operations can be done element-wise

View file

@ -0,0 +1,3 @@
declare x(5) initial (1,3,5,7,8);
x = sqrt(x);
x = sin(x);