classes.tuple: document final class declaration
parent
9debed1c75
commit
c5259f2e2c
|
@ -191,6 +191,8 @@ $nl
|
|||
"tuple-inheritance-example"
|
||||
"tuple-inheritance-anti-example"
|
||||
}
|
||||
"Declaring a tuple class final prohibits other classes from subclassing it:"
|
||||
{ $subsections POSTPONE: final }
|
||||
{ $see-also "call-next-method" "parametrized-constructors" "unions" "mixins" } ;
|
||||
|
||||
ARTICLE: "tuple-introspection" "Tuple introspection"
|
||||
|
@ -441,3 +443,6 @@ HELP: boa
|
|||
{ $description "Creates a new instance of " { $snippet "class" } " and fill in the slots from the stack, with the top-most stack element being stored in the right-most slot." }
|
||||
{ $notes "The name " { $snippet "boa" } " is shorthand for “by order of arguments”, and “BOA constructor” is a pun on “boa constrictor”." }
|
||||
{ $errors "Throws an error if the slot values do not match class declarations on slots (see" { $link "tuple-declarations" } ")." } ;
|
||||
|
||||
HELP: bad-superclass
|
||||
{ $error-description "Thrown if an attempt is made to subclass a class that is not a tuple class, or a tuple class declared " { $link POSTPONE: final } "." } ;
|
||||
|
|
|
@ -792,6 +792,10 @@ $nl
|
|||
{ $code "TUPLE: person" "{ age integer initial: 0 }" "{ department string initial: \"Marketing\" }" "manager ;" }
|
||||
} ;
|
||||
|
||||
HELP: final
|
||||
{ $syntax "TUPLE: ... ; final" }
|
||||
{ $description "Declares the most recently defined word as a final tuple class which cannot be subclassed. Attempting to subclass a final class raises a " { $link bad-superclass } " error." } ;
|
||||
|
||||
HELP: initial:
|
||||
{ $syntax "TUPLE: ... { slot initial: value } ... ;" }
|
||||
{ $values { "slot" "a slot name" } { "value" "any literal" } }
|
||||
|
|
Loading…
Reference in New Issue