summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-05-03 21:34:14 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-05-03 21:34:14 -0700
commitc6cd8acac9f6c6916aded21ea1e82d430036d04d (patch)
tree357ea3ea2a9c19cba725c20a8a16423a150bcf26 /eval.c
parent251546a2204692c62cb51bee44c3a7601d82b83b (diff)
downloadtxr-c6cd8acac9f6c6916aded21ea1e82d430036d04d.tar.gz
txr-c6cd8acac9f6c6916aded21ea1e82d430036d04d.tar.bz2
txr-c6cd8acac9f6c6916aded21ea1e82d430036d04d.zip
Deal with bad quote syntax.
* eval.c (op_quote): Throw error on bad syntax. * lib.c (obj_print, obj_pprint): Do not hide bad quote syntax using ' notation; print it using ordinary notation.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 0149c764..87a6b875 100644
--- a/eval.c
+++ b/eval.c
@@ -1102,6 +1102,10 @@ static val eval_prog1(val forms, val env, val ctx_form)
static val op_quote(val form, val env)
{
+ val d = cdr(form);
+
+ if (!consp(d) || cdr(d))
+ eval_error(form, lit("bad quote syntax"), nao);
return second(form);
}