summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-07-11 07:36:45 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-07-11 07:36:45 -0700
commit22e433ad028eb5625cc23b2eb788ddea84957139 (patch)
tree66f116c9dc3f9a767b147a6782d181302e2608c8
parentbeec4b47ad9d02a2ca44258d9c508f78b0c0af68 (diff)
downloadtxr-22e433ad028eb5625cc23b2eb788ddea84957139.tar.gz
txr-22e433ad028eb5625cc23b2eb788ddea84957139.tar.bz2
txr-22e433ad028eb5625cc23b2eb788ddea84957139.zip
Fix diagnostics which call non-symbol a symbol.
* eval.c (me_load_for): An object which is not one of the valid clause symbols is not necessarily a symbol; don't call it one in the diagnostic. * stdlib/struct.tl (sys:check-slot): Similarly, an object that isn't the name of a struct slot isn't necessarily a symbol; don't call it one.
-rw-r--r--eval.c3
-rw-r--r--stdlib/struct.tl2
2 files changed, 4 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 1aeb1c6a..fe45ae89 100644
--- a/eval.c
+++ b/eval.c
@@ -4677,6 +4677,9 @@ static val me_load_for(val form, val menv)
if (consp(arg)) {
val kind = car(arg);
+ if (!symbolp(kind))
+ expand_error(form, lit("~s: clause symbol expected, not ~s"),
+ sym, kind, nao);
if (kind != usr_var_s && kind != fun_s && kind != macro_s
&& kind != struct_s && kind != pkg_s)
expand_error(form, lit("~s: unrecognized clause symbol ~s"),
diff --git a/stdlib/struct.tl b/stdlib/struct.tl
index b6f545f4..6e8036f7 100644
--- a/stdlib/struct.tl
+++ b/stdlib/struct.tl
@@ -231,7 +231,7 @@
(unless (or (sys:slot-types slot)
(sys:static-slot-types slot))
(compile-defr-warning form ^(slot . ,slot)
- "symbol ~s isn't the name of a struct slot"
+ "~s isn't the name of a struct slot"
slot))
slot)