diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-02-09 13:57:54 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-02-09 13:57:54 -0500 |
| commit | be87d8169d98eb358891d155ce84cff311ec27c2 (patch) | |
| tree | a609244e8c1eae1f2a8679da4b8bdc83fdc8cf20 /repl.c | |
| parent | 6310f0565641dd64ae435c6a352c76e54fb9ddba (diff) | |
Convert the logic for finding closed variables to a more pure functional
style with fewer side effects
Diffstat (limited to 'repl.c')
| -rw-r--r-- | repl.c | 6 |
1 files changed, 0 insertions, 6 deletions
@@ -36,12 +36,6 @@ typedef struct { static PUREFUNC repl_binding_t *get_repl_binding(env_t *env, const char *name) { repl_binding_t *b = Table$str_get(*env->locals, name); - if (b) return b; - for (fn_ctx_t *fn_ctx = env->fn_ctx; fn_ctx; fn_ctx = fn_ctx->parent) { - if (!fn_ctx->closure_scope) continue; - b = Table$str_get(*fn_ctx->closure_scope, name); - if (b) return b; - } return b; } |
