-
Notifications
You must be signed in to change notification settings - Fork 0
Home
pheuter edited this page Sep 12, 2010
·
4 revisions
Provide means of quick and fun programming on the stack, both client (DOM) and server-side (Node).
1 1 +
2
9 5 -
4
7 6 *
42
100 10 /
10
2 6 ^
64
10 10 =
t
2 2 <=
t
5 6 >
f
f f and
f
t f or
t
5 print
5
"Hello" println
Hello\n
5 6 drop
5
5 7 nip
7
13 dup
13 13
9 10 over
9 10 9
1 2 3 swap
1 3 2
{ 1 2 "hello" } length
3
"Hello, World" length
12
1 5 range
{1 2 3 4 5}
3 7 range reverse
{7 6 5 4 3}
"racecar" reverse
"racecar"
[ 1 1 + ] call
2
1 5 range [ dup * ] map
{1 4 9 16 25}
{"hello" "world!"} [ length ] each
5 6
1 5 range 1 [ * ] reduce
120
144 12 2 ^ = [ "If true" ] [ "If false" ] if
"If true"
: factorial | 1 swap range 1 [ * ] reduce ;
5 factorial
120