Elm step 7-9
[jackhill/mal.git] / elm / step5_tco.elm
index b8f205b..34409fb 100644 (file)
@@ -43,7 +43,7 @@ init { args } =
             Core.ns
 
         evalMalInit =
-            Core.malInit
+            malInit
                 |> List.map rep
                 |> justValues
                 |> List.foldl
@@ -53,6 +53,14 @@ init { args } =
         runInit initEnv evalMalInit
 
 
+malInit : List String
+malInit =
+    [ """(def! not
+            (fn* (a)
+                (if a false true)))"""
+    ]
+
+
 update : Msg -> Model -> ( Model, Cmd Msg )
 update msg model =
     case model of
@@ -158,7 +166,7 @@ debug msg f e =
 eval : MalExpr -> Eval MalExpr
 eval ast =
     let
-        apply expr =
+        apply expr env =
             case expr of
                 MalApply app ->
                     Left
@@ -473,6 +481,7 @@ evalFn args =
                         { frameId = frameId
                         , lazyFn = lazyFn
                         , eagerFn = lazyFn >> Eval.andThen eval
+                        , isMacro = False
                         }
 
         go bindsList body =