diff options
| -rw-r--r-- | examples/helloworld1.pcdt | 1 | ||||
| -rw-r--r-- | examples/helloworld2.pcdt | 2 | ||||
| -rw-r--r-- | examples/recursion.pcdt | 2 | ||||
| -rw-r--r-- | examples/scopetest.pcdt | 2 | ||||
| -rw-r--r-- | src/eval.c | 8 |
5 files changed, 6 insertions, 9 deletions
diff --git a/examples/helloworld1.pcdt b/examples/helloworld1.pcdt deleted file mode 100644 index a52e207..0000000 --- a/examples/helloworld1.pcdt +++ /dev/null @@ -1 +0,0 @@ -store(hello world; hlVar;) diff --git a/examples/helloworld2.pcdt b/examples/helloworld2.pcdt deleted file mode 100644 index 084ce45..0000000 --- a/examples/helloworld2.pcdt +++ /dev/null @@ -1,2 +0,0 @@ -@helloworld1.pcdt -store(print(hlVar()) HelloWorldFunc;) diff --git a/examples/recursion.pcdt b/examples/recursion.pcdt index 88b81f5..3f57a6e 100644 --- a/examples/recursion.pcdt +++ b/examples/recursion.pcdt @@ -1,2 +1,2 @@ -store( (print(arg0()) incFunc(sum(1; arg0())) ) incFunc;) +store( ref((print(arg0()) incFunc(sum(1; arg0())))) incFunc;) incFunc(0;) diff --git a/examples/scopetest.pcdt b/examples/scopetest.pcdt index 2aeb6ad..78418e2 100644 --- a/examples/scopetest.pcdt +++ b/examples/scopetest.pcdt @@ -1,2 +1,2 @@ -store(ref(print(hello;)) myFunc;) +store(ref(ref(print(hello;))) myFunc;) eval(myFunc()) @@ -98,15 +98,15 @@ sym_t* try_eval_internal(sym_t* symbol, hashtable_t* symbolScope) { return symbol->args[0]; } else if (hash == get_hash("eval")) { - hashtable_t* newScope = init_hashtable(50, symbolScope); + //hashtable_t* newScope = init_hashtable(50, symbolScope); sym_t* v; if (symbol->argCount > 1) { - v = eval_with_args(eval(symbol->args[0], symbolScope), symbol->args + 1, symbol->argCount - 1, newScope); + v = eval_with_args(eval(symbol->args[0], symbolScope), symbol->args + 1, symbol->argCount - 1, symbolScope); } else { - v = eval(eval(symbol->args[0], symbolScope), newScope); + v = eval(eval(symbol->args[0], symbolScope), symbolScope); } - destroy_hashtable(newScope); + //destroy_hashtable(newScope); return v; } else if (hash == get_hash("store")) { |
