summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-03-24 20:11:04 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-03-24 20:11:04 -0700
commit8b235dfe5e0d99661cbd39a8e09095aef180ff21 (patch)
treeb2c482ec2be5a3278e87442dfd28e5fd546cbb7c
parentd564ec02758e3347d32cbda519ab9a0ccfdc5806 (diff)
downloadtxr-8b235dfe5e0d99661cbd39a8e09095aef180ff21.tar.gz
txr-8b235dfe5e0d99661cbd39a8e09095aef180ff21.tar.bz2
txr-8b235dfe5e0d99661cbd39a8e09095aef180ff21.zip
Short-circuit lisp-1 expander for atoms.
* eval.c (expand_lisp1): if the form is an atom that is not a bindable symbol, just return it; don't wastefully call into expand which has to save and restore some context.
-rw-r--r--eval.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index a5e5e45a..b6cfbb87 100644
--- a/eval.c
+++ b/eval.c
@@ -2961,6 +2961,9 @@ tail:
return form;
}
+ if (atom(form))
+ return form;
+
return expand(form, menv);
}