Wrap BlockClosure into Fn to work around a bug
[jackhill/mal.git] / gst / step6_file.st
index 8315042..758cc68 100644 (file)
@@ -124,8 +124,8 @@ Object subclass: MAL [
                 function := forms first.
                 args := forms allButFirst asArray.
 
-                function class = BlockClosure ifTrue: [ ^function value: args ].
-                function class = Func ifTrue: [
+                function type = #fn ifTrue: [ ^function fn value: args ].
+                function type = #func ifTrue: [
                     | env_ |
                     sexp := function ast.
                     env_ := Env new: function env binds: function params
@@ -157,7 +157,7 @@ argv notEmpty ifTrue: [ argv := argv allButFirst ].
 argv := OrderedCollection from: (argv collect: [ :arg | MALString new: arg ]).
 
 Core Ns keysAndValuesDo: [ :op :block | replEnv set: op value: block ].
-replEnv set: #eval value: [ :args | MAL EVAL: args first env: replEnv ].
+replEnv set: #eval value: (Fn new: [ :args | MAL EVAL: args first env: replEnv ]).
 replEnv set: #'*ARGV*' value: (MALList new: argv).
 
 MAL rep: '(def! not (fn* (a) (if a false true)))' env: replEnv.