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
commitc30b2e1f2ee749ca0d0972776c54f560d1debf76 (patch)
treeb2c482ec2be5a3278e87442dfd28e5fd546cbb7c
parent091913bddc128fab2e64cf790e3ee9c3f10ae52f (diff)
downloadtxr-c30b2e1f2ee749ca0d0972776c54f560d1debf76.tar.gz
txr-c30b2e1f2ee749ca0d0972776c54f560d1debf76.tar.bz2
txr-c30b2e1f2ee749ca0d0972776c54f560d1debf76.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);
}