From be87d8169d98eb358891d155ce84cff311ec27c2 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 9 Feb 2025 13:57:54 -0500 Subject: Convert the logic for finding closed variables to a more pure functional style with fewer side effects --- repl.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'repl.c') 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; } -- cgit v1.2.3