summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--txr.123
1 files changed, 21 insertions, 2 deletions
diff --git a/txr.1 b/txr.1
index 4c0abd76..11b1ece9 100644
--- a/txr.1
+++ b/txr.1
@@ -23725,9 +23725,14 @@ from
.code copy
will call the most derived override of that method.
-A derived method can use the
+To call the corresponding method in the base class, a given derived method
+can use the
.code call-super-fun
-to call the corresponding method in the base class.
+function, or else the
+.code "(meth ...)"
+syntax in the first position of a compound form, in place of a function name.
+Examples of both are given in the documentation for
+.codn call-super-fun .
Thus derived structs can inherit the copy handling logic from base structs, and
extend it with their own.
@@ -24417,6 +24422,20 @@ Print a message and call supertype method:
base fun method called with arg 42
.cble
+Note that a static method or function in any structure type
+can be invoked by using the
+.code "(meth ...)"
+name syntax in the first position of a compound form, as
+a function name. Thus, the above
+.code "derived fun"
+can also be written:
+
+.cblk
+ (defmeth derived fun (obj arg)
+ (format t "derived fun method called with arg ~s\en" arg)
+ ((meth base fun) obj arg))
+.cble
+
.coNP Macro @ with-objects
.synb
.mets (with-objects >> ({( sym << init-form )}*) << body-form *)