🕸️ Try-Catch
This commit is contained in:
@ -86,6 +86,8 @@ eval env (Apply e1 e2) =
|
||||
(_, Left err) -> Left err
|
||||
(Right (ValFun env2 var e3), Right x) -> eval (envExtend var x env2) e3
|
||||
(_, _) -> Left "Applying non-function"
|
||||
eval env (TryCatch e1 e2) =
|
||||
case (eval env e1) of
|
||||
(Right x) -> Right x
|
||||
(Left _) -> eval env e2
|
||||
|
||||
|
||||
-- TODO: Add cases after extending Exp.
|
||||
|
Reference in New Issue
Block a user