diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-11-30 07:42:39 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-11-30 07:42:39 -0800 |
commit | a35352076ebdadf1a522e0e80ffaef83c91ef1e1 (patch) | |
tree | 045b224f04742a7be85c804fa77242f29a531878 | |
parent | 7ef6686ce7020df5618cd5c9ed737c4655f08ef4 (diff) | |
download | txr-a35352076ebdadf1a522e0e80ffaef83c91ef1e1.tar.gz txr-a35352076ebdadf1a522e0e80ffaef83c91ef1e1.tar.bz2 txr-a35352076ebdadf1a522e0e80ffaef83c91ef1e1.zip |
Correct return value of defmeth.
* share/txr/stdlib/struct.tl (defmeth): Return the
symbol being defined.
-rw-r--r-- | share/txr/stdlib/struct.tl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/share/txr/stdlib/struct.tl b/share/txr/stdlib/struct.tl index 5165fd29..ee281168 100644 --- a/share/txr/stdlib/struct.tl +++ b/share/txr/stdlib/struct.tl @@ -211,9 +211,10 @@ (defun sys:defmeth (type-sym name fun) (let ((type (find-struct-type type-sym))) - (if type - (static-slot-ensure type-sym name fun) - (throwf 'eval-error "~s: ~s isn't a struct type" 'defmeth type-sym)))) + (unless type + (throwf 'eval-error "~s: ~s isn't a struct type" 'defmeth type-sym)) + (static-slot-ensure type-sym name fun) + name)) (defmacro defmeth (type-sym name arglist . body) ^(sys:defmeth ',type-sym ',name (lambda ,arglist |