summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-10-02 06:59:15 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-10-02 06:59:15 -0700
commitc4a66ad7ed5c74cda3a16b191c6763c1a5cedc6d (patch)
treece0cf1bfc1d3c471760ffcc8905e485780f03853 /share
parentbfd251f813aee284d9cd3886a5aeffdb58497ea6 (diff)
downloadtxr-c4a66ad7ed5c74cda3a16b191c6763c1a5cedc6d.tar.gz
txr-c4a66ad7ed5c74cda3a16b191c6763c1a5cedc6d.tar.bz2
txr-c4a66ad7ed5c74cda3a16b191c6763c1a5cedc6d.zip
Struct methods and functions set up named block.
* share/txr/stdlib/struct.tl (defstruct): Generate a named block around the body forms of the :method and :function lambdas, whose name matches the slot name. * txr.1: Documented.
Diffstat (limited to 'share')
-rw-r--r--share/txr/stdlib/struct.tl8
1 files changed, 6 insertions, 2 deletions
diff --git a/share/txr/stdlib/struct.tl b/share/txr/stdlib/struct.tl
index 24bccbe5..3958692c 100644
--- a/share/txr/stdlib/struct.tl
+++ b/share/txr/stdlib/struct.tl
@@ -46,9 +46,13 @@
"~s: method ~s needs \
\ at least one parameter"
'defstruct name))
- ^(:static ,name (lambda ,args ,*body)))
+ ^(:static ,name
+ (lambda ,args
+ (block ,name ,*body))))
(:function ^(:static ,name
- (lambda ,args ,*body)))
+ (lambda ,args
+ (block ,name
+ ,*body))))
((:static :instance)
(when body
(sys:bad-slot-syntax slot))