summaryrefslogtreecommitdiffstats
path: root/lisplib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-12-31 20:37:37 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-12-31 20:37:37 -0800
commit0f544070713a7dd93aa759dd71cf02fadd05814c (patch)
tree742fd78637bcf1f47004c8fcb5b8db3b86fd515b /lisplib.c
parent90ff8d6428d0fb99459d3794077dc47fe618c73f (diff)
downloadtxr-0f544070713a7dd93aa759dd71cf02fadd05814c.tar.gz
txr-0f544070713a7dd93aa759dd71cf02fadd05814c.tar.bz2
txr-0f544070713a7dd93aa759dd71cf02fadd05814c.zip
Bugfix: repeated expansion of catch unstable.
It turns out we have a silly problem: catch is a special operator, which undergoes a macro-like expansion which alters its syntax, but uses the same operator symbol. We turn catch into a macro which expands to a sys:catch operator. * eval.c (sys_catch_s): New symbol variable. (expand_catch): Function now expands sys:catch forms without altering any syntax. (do_expand): Check for sys:catch rather than catch. Call expand_catch differently: it takes the form now instead of just the arguments, so it can return the original form if no expansion takes place. (eval_init): Initialize sys_catch_s variable. Change registration of op_catch to sys:catch symbol. * lisplib.c (except_set_entries): Add catch to the list of autoload symbols for except.tl. * share/txr/stdlib/except.tl (catch): New macro for transforming catch to sys:catch. * txr.1: Reclassify catch operator as a macro.
Diffstat (limited to 'lisplib.c')
-rw-r--r--lisplib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisplib.c b/lisplib.c
index 76e142e8..2423274a 100644
--- a/lisplib.c
+++ b/lisplib.c
@@ -239,7 +239,7 @@ static val hash_instantiate(val set_fun)
static val except_set_entries(val dlt, val fun)
{
val name[] = {
- lit("handle"), lit("ignwarn"), lit("macro-time-ignwarn"),
+ lit("catch"), lit("handle"), lit("ignwarn"), lit("macro-time-ignwarn"),
nil
};
set_dlt_entries(dlt, name, fun);