summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/eval.c b/eval.c
index 3c4aa120..c0adfa0c 100644
--- a/eval.c
+++ b/eval.c
@@ -721,13 +721,10 @@ static val op_defvar(val form, val env)
eval_error(form, lit("let: ~s is not a bindable sybol"), sym, nao);
{
- val value = eval(second(args), env, form);
- val existing = gethash(top_vb, sym);
-
- if (existing)
- set(*cdr_l(existing), value);
- else
+ if (!gethash(top_vb, sym)) {
+ val value = eval(second(args), env, form);
sethash(top_vb, sym, cons(sym, value));
+ }
}
return sym;