|
|
@@ -1,12 +1,12 @@
|
|
1
|
|
-# This is a test program
|
|
2
|
|
-(assign twelve 12) # This assigns the variable twelve, to the number literal 12
|
|
3
|
|
-(assign myvar (add twelve (subtract 6 2))) # This assigns the variable myvar, to the result of adding the variable twelve to the result of subtracting 2 from 6
|
|
4
|
|
-(log myvar) # This logs the value of myvar
|
|
5
|
|
-(log 6) # This logs the number literal 6
|
|
6
|
|
-(assign twelve myvar) # This reassigns the variable twelve to the value of the variable myvar
|
|
7
|
|
-(log twelve) # This logs the new value of the variable twelve
|
|
8
|
|
-# An example function definition
|
|
9
|
|
-(def myF
|
|
|
1
|
+; This is a test program
|
|
|
2
|
+(assign twelve 12) ; This assigns the variable twelve, to the number literal 12
|
|
|
3
|
+(assign myvar (add twelve (subtract 6 2))) ; This assigns the variable myvar, to the result of adding the variable twelve to the result of subtracting 2 from 6
|
|
|
4
|
+(log myvar) ; This logs the value of myvar
|
|
|
5
|
+(log 6) ; This logs the number literal 6
|
|
|
6
|
+(assign twelve myvar) ; This reassigns the variable twelve to the value of the variable myvar
|
|
|
7
|
+(log twelve) ; This logs the new value of the variable twelve
|
|
|
8
|
+; An example function definition
|
|
|
9
|
+(def myF ; Anywhere is a valid position for a comment!
|
|
10
|
10
|
(log 0)
|
|
11
|
11
|
(log twelve)
|
|
12
|
12
|
(log 6)
|
|
|
@@ -14,12 +14,12 @@
|
|
14
|
14
|
(assign scopelol (add twelve 5))
|
|
15
|
15
|
(log scopelol)
|
|
16
|
16
|
)
|
|
17
|
|
-(def argTest (log $1) (log $2)) # Functions take an unlimited number of arguments that can be referred to by $n
|
|
18
|
|
-(myF) # Calling an argument-less function
|
|
|
17
|
+(def argTest (log $1) (log $2)) ; Functions take an unlimited number of arguments that can be referred to by $n
|
|
|
18
|
+(myF) ; Calling an argument-less function
|
|
19
|
19
|
(log 0)
|
|
20
|
20
|
(log 0)
|
|
|
21
|
+(log 1)
|
|
21
|
22
|
(log 0)
|
|
22
|
23
|
(log 0)
|
|
23
|
24
|
(log 0)
|
|
24
|
|
-(log 0)
|
|
25
|
|
-(argTest 43 scopelol) # Custom functions with arguments are called like any other
|
|
|
25
|
+(argTest 43 scopelol) ; Custom functions with arguments are called like any other
|