summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-12-12 18:10:17 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-12-13 08:19:53 -0800
commitb1fe95fef05b7e8d26ff82645d373c2ef0b5c449 (patch)
tree7220391285ce26f06a969d7087396275e50d2e46 /txr.1
parent2eaa8bdbb3a6d426a9de4d916dad63f77fd54092 (diff)
downloadtxr-b1fe95fef05b7e8d26ff82645d373c2ef0b5c449.tar.gz
txr-b1fe95fef05b7e8d26ff82645d373c2ef0b5c449.tar.bz2
txr-b1fe95fef05b7e8d26ff82645d373c2ef0b5c449.zip
multiple-inheritance: super-method loose ends.
* struct.c (do_super): New function. Now the common implementation for call_super_method, call_super_fun and super_method. (call_super_method, call_super_fun): Reduced to small wrappers around do_super. (super_method): Drill into the object to geet the struct_type handle, and then use do_super to get the method. * tests/012/oop-mi.tl: New tests for call-super-fun and call-super-method. * tests/012/oop-mi.expected: Updated. * txr.1: Updated.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.127
1 files changed, 16 insertions, 11 deletions
diff --git a/txr.1 b/txr.1
index 1954eaf5..46e81355 100644
--- a/txr.1
+++ b/txr.1
@@ -27442,7 +27442,7 @@ the slot name isn't a computed value.
The
.code super-method
function retrieves a function from a static
-slot belonging to the supertype of the structure type of
+slot belonging to one of the direct supertypes of the structure type of
.metn struct-obj .
It then returns a function which binds
@@ -27450,11 +27450,14 @@ that function's left argument to the structure.
The
.meta struct-obj
-argument must be a structure which has a supertype, and
+argument must be a structure which has at least one supertype, and
.meta slot-name
-must be a symbol denoting a static slot in that supertype.
+must be a symbol denoting a static slot in one of those supertypes.
The slot must hold a function of at least one
-argument.
+argument. The supertypes are searched from left to right for a static
+slot named
+.metn slot-name ;
+when the first such slot is found, its value is used.
The
.code super-method
@@ -27768,9 +27771,9 @@ should be reworked in terms of
The
.code call-super-method
-retrieves the function stored in the slot
+retrieves the function stored in the static slot
.meta name
-of the supertype of
+of one of the direct supertypes of
.meta struct-obj
and invokes it, passing to that function
.meta struct-obj
@@ -27781,10 +27784,11 @@ if any.
The
.meta struct-obj
argument must be of structure type. Moreover,
-that structure type must be derived from another structure type,
+that structure type must be derived from one or more supertypes,
and
.meta name
-must name a static slot of that structure type.
+must name a static slot available from at least one of those supertypes.
+The supertypes are searched left to right in search of this slot.
The object retrieved from that static slot must be
callable as a function, and accept the arguments.
@@ -27808,7 +27812,7 @@ The
.code call-super-fun
retrieves the function stored in the slot
.meta name
-of the supertype of
+of one of the supertypes of
.meta type
and invokes it, passing to that function the given
.metn argument -s,
@@ -27817,10 +27821,11 @@ if any.
The
.meta type
argument must be a structure type. Moreover,
-that structure type must be derived from another structure type,
+that structure type must be derived from one or more supertypes,
and
.meta name
-must name a static slot of that structure type.
+must name a static slot available from at least one of those supertypes.
+The supertypes are searched left to right in search of this slot.
The object retrieved from that static slot must be
callable as a function, and accept the arguments.