(define) evaluates definition
authorDavid Kerkeslager <kerkeslager@gmail.com>
Tue, 1 Sep 2015 02:25:13 +0000 (22:25 -0400)
committerDavid Kerkeslager <kerkeslager@gmail.com>
Tue, 1 Sep 2015 02:28:56 +0000 (22:28 -0400)
integration_tests/0004_define_evaluates_definition.stt [new file with mode: 0644]
integration_tests/0004_define_evaluates_definition.txt [new file with mode: 0644]
stutter.py

diff --git a/integration_tests/0004_define_evaluates_definition.stt b/integration_tests/0004_define_evaluates_definition.stt
new file mode 100644 (file)
index 0000000..17afe15
--- /dev/null
@@ -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 (file)
index 0000000..dbe9dba
--- /dev/null
@@ -0,0 +1 @@
+Hello, world
\ No newline at end of file
index 7b70dce..c2139e5 100644 (file)
@@ -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);