summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-10-17 08:12:10 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-10-17 08:12:10 -0700
commit8357dd0ce75b5cace504acfcef2c31ee83a35e9c (patch)
tree4487382d7fd86c7132bccf80ba26b3fab8af8db3 /txr.1
parent74ea4ee2f89457adbe5cf6facadd8e8b389517ab (diff)
downloadtxr-8357dd0ce75b5cace504acfcef2c31ee83a35e9c.tar.gz
txr-8357dd0ce75b5cace504acfcef2c31ee83a35e9c.tar.bz2
txr-8357dd0ce75b5cace504acfcef2c31ee83a35e9c.zip
defstruct: new :inherit clause.
The :inherit clause allows custom struct clauses to inject inherited bases. * stdlib/struct.tl (defstruct): Recognize :inherit clause, adding symbol arguments to extra list of supers that get appended to the list coming from defstruct's seconda rgument. (define-struct-clause): Disallow :inherit clause name. * tests/012/oop-dsc.tl: New tests. * txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.124
1 files changed, 24 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index a15cb390..2342276d 100644
--- a/txr.1
+++ b/txr.1
@@ -29602,6 +29602,30 @@ form, all the
finalizers execute after all the
.code :fini
finalizers regardless of the order in which they appear.
+
+.meIP (:inherit << super *)
+The
+.code :inherit
+clause specifies zero or more types to be inherited. Each
+.meta super
+argument must be a symbol which is the name of an existing struct type.
+These symbols are appended to the list of supertypes coming from the
+.meta super
+argument
+.codn defstruct .
+Note: the motivation behind
+.code :inherit
+is to make it possible for struct clauses defined by
+.code define-struct-clause
+to inject supertypes. Developers are encouraged to use the regular
+.meta super
+argument of
+.code defstruct
+to declare inheritance of supertypes, rather than writing visible
+.code :inherit
+clauses that can be moved into the
+.meta super
+argument.
.RE
.IP
The slot names given in a