fix calls not restoring environment

This commit is contained in:
darkf 2013-10-23 01:59:15 -07:00
parent 639b5646e0
commit 04c227e0e9
1 changed files with 2 additions and 2 deletions

View File

@ -154,9 +154,9 @@ eval (Call name arg) = get >>= \(h,env) ->
Just fn@(FnV cls _) -> do
arg' <- eval arg
put (h,cls) -- enter closure env
let v = apply fn arg'
v <- apply fn arg'
put (h,env) -- restore env
v
return v
Just fn@(Builtin _) -> eval arg >>= apply fn
Nothing -> error $ "call: name " ++ name ++ " doesn't exist or is not a function"