summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-11-30 07:42:39 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-11-30 07:42:39 -0800
commita35352076ebdadf1a522e0e80ffaef83c91ef1e1 (patch)
tree045b224f04742a7be85c804fa77242f29a531878 /share
parent7ef6686ce7020df5618cd5c9ed737c4655f08ef4 (diff)
downloadtxr-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.
Diffstat (limited to 'share')
-rw-r--r--share/txr/stdlib/struct.tl7
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