nil 42 3.140000 string Symbol newline Object => Lambda => Closure => o = Object.new() => <> o = Object.new(foo:42, bar: 666) => <> | bar: 666 | foo: 42 o.foo => 42 Point.new() => <> Point.new(x: 3, y: 4) => <> | x: 3 | y: 4 twice 21 is 42 double => <> | environment: nil | function: <> | | body: <> | | | 0: <> | | | | operation: 13 | | | | 0: <> | | | | | name: x | | | | 1: <> | | | | | name: x | | parameters: <> | | | 0: x Point.new(x:3, y:4).magnitude() => 5.000000 <> | self: nil => | n: 39 | self: nil | 0: 40 40 <> | self: nil => | n: 40 | self: nil | 0: 40 41 <> | self: nil => | n: 41 | self: nil | 0: 40 42 <> | self: nil => | n: 42 | self: nil | 0: 40 43 | __codeon__: | __eval__: | __name__: Object | allKeys: | findKey: | includes: | keys: | length: | new: | pop: | push: | reversed: | sorted: nil no 1 yes hello yes 15 1973 42 42 42 42 ok ok 42 ---- MyType.__eval__() invoked 42 <> ==== 42 hello nil nil [KEY: __delegate__ KEY: x KEY: y ] Symbol nil POINT P <> P <> Q <> P.mag 13.000000 <> | bar: 666 | foo: 42 | 0: 1 | 1: <> | | 0: 2 | | 1: 3 | | 2: 42 [KEY: __delegate__ KEY: bar KEY: foo ] 5 7 0 1 2 0 1 0: a 2 0: a 1: b 3 0: a 1: b 2: c 12 0: 104 1: 101 2: 108 3: 108 4: 111 5: 44 6: 32 7: 119 8: 111 9: 114 10: 108 11: 100 hello, world hallo, world hally, world hally, wirld READ = f() { print(__env__()) } f(); 0 30 t <> f 102 ( 40 ) 41 32 { 123 32 p 112 r 114 i 105 n 110 t 116 ( 40 _ 95 _ 95 e 101 n 110 v 118 _ 95 _ 95 ( 40 ) 41 ) 41 32 } 125 10 f 102 ( 40 ) 41 ; 59 10 42 42 42 42 MACRO table <> | assert: <> | | environment: nil | | function: <> | | | body: <> | | | | 0: <> | | | | | operation: 3 | | | | | 0: <> | | | | | | body: <> | | | | | | | 0: <> | | | | | | | | alternate: nil | | | | | | | | condition: <> | | | | | | | | | operation: 0 | | | | | | | | | 0: <> | | | | | | | | | | arguments: <> | | | | | | | | | | | 0: <> | | | | | | | | | | | | operation: 4 | | | | | | | | | | | | 0: <> | | | | | | | | | | | | | name: x | | | | | | | | | | function: <> | | | | | | | | | | | name: eval | | | | | | | | consequent: <> | | | | | | | | | body: <> | | | | | | | | | | 0: <> | | | | | | | | | | | arguments: <> | | | | | | | | | | | | 0: "\nassertion failed: " | | | | | | | | | | | | 1: <> | | | | | | | | | | | | | operation: 4 | | | | | | | | | | | | | 0: <> | | | | | | | | | | | | | | arguments: <> | | | | | | | | | | | | | | | 0: <> | | | | | | | | | | | | | | | | name: x | | | | | | | | | | | | | | function: <> | | | | | | | | | | | | | | | name: codeString | | | | | | | | | | | | 2: "\n" | | | | | | | | | | | function: <> | | | | | | | | | | | | name: print | | | | | | | | | | 1: <> | | | | | | | | | | | arguments: <> | | | | | | | | | | | | 0: 1 | | | | | | | | | | | function: <> | | | | | | | | | | | | name: exit | | | parameters: <> | | | | 0: x | test: <> | | environment: nil | | function: <> | | | body: <> | | | | 0: <> | | | | | arguments: <> | | | | | | 0: "MACRO EVAL test with " | | | | | | 1: <> | | | | | | | name: x | | | | | | 2: " and " | | | | | | 3: <> | | | | | | | name: y | | | | | | 4: "\n" | | | | | function: <> | | | | | | name: print | | | | 1: <> | | | | | operation: 3 | | | | | 0: <> | | | | | | body: <> | | | | | | | 0: <> | | | | | | | | arguments: <> | | | | | | | | | 0: "REPLACEMENT " | | | | | | | | | 1: <> | | | | | | | | | | operation: 4 | | | | | | | | | | 0: <> | | | | | | | | | | | name: x | | | | | | | | | 2: "\n" | | | | | | | | function: <> | | | | | | | | | name: print | | | | | | | 1: <> | | | | | | | | operation: 4 | | | | | | | | 0: <> | | | | | | | | | name: y | | | parameters: <> | | | | 0: x | | | | 1: y define testfun MACRO EVAL test with 1 and 2 MACRO EVAL test with three and four call testfun REPLACEMENT 1 REPLACEMENT three MakeSeven.__eval__ invoked AST eval => 42 0 1 2 3 4 5 6 7 8 9 10 10 9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9 65 66 67 68 69 1 two 3 four *: type error: illegal operand types: and 13: n * factorial(n - 1) 12: if (n < 2) nil else n * factorial(n - 1) 11: factorial(n - 1) 10: n * factorial(n - 1) 9: if (n < 2) nil else n * factorial(n - 1) 8: factorial(n - 1) 7: n * factorial(n - 1) 6: if (n < 2) nil else n * factorial(n - 1) 5: factorial(n - 1) 4: n * factorial(n - 1) 3: if (n < 2) nil else n * factorial(n - 1) 2: factorial(5) 1: { factorial(5) } 0: try { factorial(5) } catch (e) { { if (!eval(e.__function__ == "*")) { print("\nassertion failed: ", "e.__function__ == \"*\"", "\n"); exit(1) } }; { if (!eval(e.__kind__ == "type error")) { print("\nassertion failed: ", "e.__kind__ == \"type error\"", "\n"); exit(1) } }; { if (!eval(e.__message__ == "illegal operand types")) { print("\nassertion failed: ", "e.__message__ == \"illegal operand types\"", "\n"); exit(1) } }; { if (!eval(e.operand1 == 2)) { print("\nassertion failed: ", "e.operand1 == 2", "\n"); exit(1) } }; { if (!eval(e.operand2 == nil)) { print("\nassertion failed: ", "e.operand2 == nil", "\n"); exit(1) } }; print(e.__function__, ": ", e.__kind__, ": ", e.__message__, ": ", typeName(e.operand1), " and ", typeName(e.operand2), "\n"); backtrace(e) }