diff --git a/Assignments/02.rkt b/Assignments/02.rkt index f19f310..cf55e67 100644 --- a/Assignments/02.rkt +++ b/Assignments/02.rkt @@ -119,10 +119,10 @@ [(leqE l r) (num2 l r (boolT))] [(varE s) (type-lookup s env)] [(lamE name te body) (arrowT (interp-te te) (typecheck body (type-extend env name (interp-te te))))] - [(appE fn arg) (type-case Type (typecheck fn env) + [(appE fn arg) (type-case Type (typecheck fn env) ; todo use local to reduce duplicate calls [(arrowT a b) (typecheck fn env)] [else (error 'app "Function application must be a function")])] - [(ifE c t f) (if (equal? (typecheck c env) (boolT)) + [(ifE c t f) (if (equal? (typecheck c env) (boolT)) ; todo use type case/local to reduce duplicate calls` (if (equal? (typecheck t env) (typecheck f env)) (typecheck t env) (error 'if "Both if conditions must be of the same type"))