This commit is contained in:
2026-02-04 11:20:46 -08:00
parent 76de232733
commit 58d081da8c

View File

@@ -84,7 +84,7 @@ You must complete the other cases.
> evaluate :: Exp -> Val > evaluate :: Exp -> Val
> evaluate ETrue = VTrue > evaluate ETrue = VTrue
> evaluate EFalse = error "TBD" > evaluate EFalse = VFalse
> evaluate (Eif e1 e2 e3) = error "TBD" > evaluate (Eif e1 e2 e3) = error "TBD"
@@ -111,5 +111,3 @@ you add in support the expressions 'succ e', 'pred e', and integers.
With this change, it is possible for evaluate to get 'stuck', With this change, it is possible for evaluate to get 'stuck',
e.g. pred true. e.g. pred true.
For a first pass, simply use the error function in these cases. For a first pass, simply use the error function in these cases.