From f6ada75b3cf9868b03fc61415a8a7857412bf0ae Mon Sep 17 00:00:00 2001 From: Isaac Shoebottom Date: Wed, 26 Mar 2025 14:28:05 -0300 Subject: [PATCH] Add todos --- Assignments/02.rkt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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"))