diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-01-03 11:14:01 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-01-03 11:14:01 -0800 |
commit | 629c448f272fe23cefe6eb2b2b90dc8dfb3bbf86 (patch) | |
tree | 426249abee0514c420066676f46247440d9d0b61 | |
parent | 9a363179de28d0bd2d367b810ba5ae0a587083cb (diff) | |
download | txr-629c448f272fe23cefe6eb2b2b90dc8dfb3bbf86.tar.gz txr-629c448f272fe23cefe6eb2b2b90dc8dfb3bbf86.tar.bz2 txr-629c448f272fe23cefe6eb2b2b90dc8dfb3bbf86.zip |
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.
-rw-r--r-- | share/txr/stdlib/struct.tl | 5 |
1 files changed, 4 insertions, 1 deletions
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)) |