From a35352076ebdadf1a522e0e80ffaef83c91ef1e1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 30 Nov 2015 07:42:39 -0800 Subject: Correct return value of defmeth. * share/txr/stdlib/struct.tl (defmeth): Return the symbol being defined. --- share/txr/stdlib/struct.tl | 7 ++++--- 1 file 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 -- cgit v1.2.3