|
|
@ -12,7 +12,18 @@ Point.new(x: 3, y: 4) => <> |
|
|
|
| y: 4 |
|
|
|
| x: 3 |
|
|
|
twice 21 is 42 |
|
|
|
double => <closure> |
|
|
|
double => <<Closure>> |
|
|
|
| environment: nil |
|
|
|
| function: <<Lambda>> |
|
|
|
| | body: <<Object>> |
|
|
|
| | | 0: <<Binop>> |
|
|
|
| | | | operation: 13 |
|
|
|
| | | | 0: <<GetVar>> |
|
|
|
| | | | | name: x |
|
|
|
| | | | 1: <<GetVar>> |
|
|
|
| | | | | name: x |
|
|
|
| | parameters: <<Object>> |
|
|
|
| | | 0: x |
|
|
|
Point.new(x:3, y:4).magnitude() => 5.000000 |
|
|
|
<<?>> |
|
|
|
| self: nil => |
|
|
@ -50,7 +61,7 @@ ok |
|
|
|
---- |
|
|
|
MyType.__eval__() invoked |
|
|
|
42 |
|
|
|
<closure> |
|
|
|
<<Closure>> |
|
|
|
==== |
|
|
|
42 |
|
|
|
hello |
|
|
@ -130,7 +141,44 @@ f 102 ( 40 ) 41 32 { 123 32 p 112 r 114 i 105 n 110 t 116 ( 40 _ 95 _ 95 e 1 |
|
|
|
42 |
|
|
|
6 * 7 |
|
|
|
MACRO table <<Object>> |
|
|
|
| test: <closure> |
|
|
|
| test: <<Closure>> |
|
|
|
| | environment: nil |
|
|
|
| | function: <<Lambda>> |
|
|
|
| | | body: <<Object>> |
|
|
|
| | | | 0: <<Call>> |
|
|
|
| | | | | arguments: <<Object>> |
|
|
|
| | | | | | 0: MACRO EVAL test with |
|
|
|
| | | | | | 1: <<GetVar>> |
|
|
|
| | | | | | | name: x |
|
|
|
| | | | | | 2: and |
|
|
|
| | | | | | 3: <<GetVar>> |
|
|
|
| | | | | | | name: y |
|
|
|
| | | | | | 4: |
|
|
|
|
|
|
|
| | | | | function: <<GetVar>> |
|
|
|
| | | | | | name: print |
|
|
|
| | | | 1: <<Unyop>> |
|
|
|
| | | | | operation: 3 |
|
|
|
| | | | | 0: <<Block>> |
|
|
|
| | | | | | body: <<Object>> |
|
|
|
| | | | | | | 0: <<Call>> |
|
|
|
| | | | | | | | arguments: <<Object>> |
|
|
|
| | | | | | | | | 0: REPLACEMENT |
|
|
|
| | | | | | | | | 1: <<Unyop>> |
|
|
|
| | | | | | | | | | operation: 4 |
|
|
|
| | | | | | | | | | 0: <<GetVar>> |
|
|
|
| | | | | | | | | | | name: x |
|
|
|
| | | | | | | | | 2: |
|
|
|
|
|
|
|
| | | | | | | | function: <<GetVar>> |
|
|
|
| | | | | | | | | name: print |
|
|
|
| | | | | | | 1: <<Unyop>> |
|
|
|
| | | | | | | | operation: 4 |
|
|
|
| | | | | | | | 0: <<GetVar>> |
|
|
|
| | | | | | | | | name: y |
|
|
|
| | | parameters: <<Object>> |
|
|
|
| | | | 0: x |
|
|
|
| | | | 1: y |
|
|
|
define testfun |
|
|
|
MACRO EVAL test with 1 and 2 |
|
|
|
MACRO EVAL test with three and four |
|
|
@ -142,6 +190,8 @@ REPLACEMENT three |
|
|
|
0 1 2 3 4 5 6 7 8 9 |
|
|
|
65 66 67 68 69 |
|
|
|
1 two 3 four |
|
|
|
|
|
|
|
test.txt:331: *: illegal operand types Integer and String |
|
|
|
11: n * factorial(n - 1) |
|
|
|
10: if (n < 2) "1" else n * factorial(n - 1) |
|
|
|
9: factorial(n - 1) |
|
|
|