@@ -1166,6 +1166,8 @@ def eval_exp(env: Env, exp: Object) -> Object:
11661166 # Y combinator or similar, so we bind functions (and only
11671167 # functions) using a letrec-like strategy. We augment their
11681168 # captured environment with a binding to themselves.
1169+ # TODO(max): Add "closure improve", which filters bindings to those
1170+ # used by the underlying function.
11691171 assert isinstance (value .env , dict )
11701172 value .env [exp .name .name ] = value
11711173 return EnvObject ({** env , exp .name .name : value })
@@ -1182,8 +1184,12 @@ def eval_exp(env: Env, exp: Object) -> Object:
11821184 if isinstance (exp , Function ):
11831185 if not isinstance (exp .arg , Var ):
11841186 raise RuntimeError (f"expected variable in function definition { exp .arg } " )
1187+ # TODO(max): Add "closure improve", which filters bindings to those
1188+ # used by the underlying function.
11851189 return Closure (env , exp )
11861190 if isinstance (exp , MatchFunction ):
1191+ # TODO(max): Add "closure improve", which filters bindings to those
1192+ # used by the underlying function.
11871193 return Closure (env , exp )
11881194 if isinstance (exp , Apply ):
11891195 if isinstance (exp .func , Var ) and exp .func .name == "$$quote" :
0 commit comments