aboutsummaryrefslogtreecommitdiff
path: root/repl.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-02-09 13:57:54 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-02-09 13:57:54 -0500
commitbe87d8169d98eb358891d155ce84cff311ec27c2 (patch)
treea609244e8c1eae1f2a8679da4b8bdc83fdc8cf20 /repl.c
parent6310f0565641dd64ae435c6a352c76e54fb9ddba (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.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/repl.c b/repl.c
index 29ed407f..3b2e1af3 100644
--- a/repl.c
+++ b/repl.c
@@ -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;
}