diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-12-09 20:20:48 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-12-09 20:20:48 -0800 |
commit | 983a0d26b0d119e0cac73e1a529541c253436d9e (patch) | |
tree | 52465e2c8f6d5b30013318160f58b80f3e2750b8 /txr.1 | |
parent | e7cb34ec471b9a212ed9d7b067c5f0bd5282c89f (diff) | |
download | txr-983a0d26b0d119e0cac73e1a529541c253436d9e.tar.gz txr-983a0d26b0d119e0cac73e1a529541c253436d9e.tar.bz2 txr-983a0d26b0d119e0cac73e1a529541c253436d9e.zip |
doc: clarify inheritance of static slot value.
* txr.1: In relation of the previous bugfix, a certain
situation is worth clarifying. A static slot does not inherit
the value of a grandparent type's static slot of the same
name, if the supertype has specified that slot as an instance
slot. Inheritance of the static slot value is from the direct
supertype only.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -25267,6 +25267,37 @@ but are of a different kind: an instance slot in the supertype can be replaced by a static slot in the derived type or .IR "vice versa" . +Note that, in light of the above type overriding possibility, the static slot +value propagation happens only from the immediate supertype. +If +.code D +is is derived from +.code G +which has a static slot +.codn s , +whereas +.code D +specifies +.code s +as an instance slot, but then +.code B +again specifies a static slot +.codn s , +then +.codn B 's +slot +.code s +will not inherit the value from +.codn G 's +.code s +slot. +Simply, +.codn B 's +supertype is +.code D +and that supertype is not considered to have a static slot +.codn s . + A structure type is associated with a static initialization function which may be used to store initial values into static slots. This function is invoked once in a type's life time, when the type is created. |