Handbook
Glossary
variant-class
Algebraic data types
Prev:
VARIANT-MEMBER:
Next:
match ( branches -- quot )
Vocabulary
variants
Class description
This class comprises class names that have been defined with
VARIANT:
. When a
variant-class
is used as the type of a specialized
tuple
slot, the variant's first member type is used as the default
initial-value
.
See also
VARIANT:
,
match
Definition
USING:
classes.mixin
words
;
IN:
variants
PREDICATE:
variant-class
<
mixin-class
"variant?"
word-prop
;
Methods
USING:
classes
sequences
slots
variants
;
M:
variant-class
initial-value*
class-members
[
f
f
]
[
first
initial-value*
]
if-empty
;