From 629c448f272fe23cefe6eb2b2b90dc8dfb3bbf86 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 3 Jan 2016 11:14:01 -0800 Subject: Better bad slot syntax diagnostic in defstruct. * share/txr/stdlib/struct.tl (defstruct): Issue different error message for a slot specifier which isn't a symbol, and wasn't recognized as a special syntax. --- share/txr/stdlib/struct.tl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/txr/stdlib/struct.tl b/share/txr/stdlib/struct.tl index 213e83cd..7e0d2af1 100644 --- a/share/txr/stdlib/struct.tl +++ b/share/txr/stdlib/struct.tl @@ -119,7 +119,10 @@ (super-type (find-struct-type super))) (whenlet ((bad [find-if [notf bindable] (append stat-slots inst-slots)])) - (throwf 'eval-error "~s: slot name ~s isn't a bindable symbol" + (throwf 'eval-error + (if (symbolp bad) + "~s: slot name ~s isn't a bindable symbol" + "~s: invalid slot specifier syntax: ~s") 'defstruct bad)) (set stat-si-forms (sys:prune-nil-inits stat-si-forms super-type)) (set inst-si-forms (sys:prune-nil-inits inst-si-forms super-type)) -- cgit v1.2.3