From: David Kerkeslager Date: Tue, 1 Sep 2015 02:25:13 +0000 (-0400) Subject: (define) evaluates definition X-Git-Url: https://code.kerkeslager.com/?a=commitdiff_plain;h=3d05741bfbf25d0dfd038767737da6f464268e08;p=sandbox (define) evaluates definition --- diff --git a/integration_tests/0004_define_evaluates_definition.stt b/integration_tests/0004_define_evaluates_definition.stt new file mode 100644 index 0000000..17afe15 --- /dev/null +++ b/integration_tests/0004_define_evaluates_definition.stt @@ -0,0 +1,4 @@ +(define hello-world "Hello, world") +(define hello-world-copy hello-world) +(print hello-world-copy) +0 diff --git a/integration_tests/0004_define_evaluates_definition.txt b/integration_tests/0004_define_evaluates_definition.txt new file mode 100644 index 0000000..dbe9dba --- /dev/null +++ b/integration_tests/0004_define_evaluates_definition.txt @@ -0,0 +1 @@ +Hello, world \ No newline at end of file diff --git a/stutter.py b/stutter.py index 7b70dce..c2139e5 100644 --- a/stutter.py +++ b/stutter.py @@ -718,7 +718,7 @@ void define(Environment** parent, Object* args) { assert(countArgs(args) == 2); Object* name = getArg(0, args); - Object* value = getArg(1, args); + Object* value = c_evaluate(parent, getArg(1, args)); assert(name->type == SYMBOL); *parent = makeEnvironmentPointer(name->instance.symbol, value, *parent);