Handbook
Glossary
define-mixin-class ( class -- )
Factor handbook
»
The language
»
Objects
»
Classes
»
Mixin classes
Prev:
INSTANCE:
Next:
add-mixin-instance ( class mixin -- )
Vocabulary
classes
.
mixin
Inputs
class
a
word
Outputs
None
Word description
Defines a mixin class. This is the run time equivalent of
MIXIN:
.
Notes
This word must be called from inside
with-compilation-unit
.
Side effects
Modifies
class
See also
mixin-class
,
add-mixin-instance
,
MIXIN:
,
INSTANCE:
Definition
USING:
classes.mixin.private
classes.private
kernel
words
;
IN:
classes.mixin
:
define-mixin-class
( class -- )
dup
mixin-class?
[
drop
]
[
[
{
}
redefine-mixin-class
]
[
H{
}
clone
"instances"
set-word-prop
]
[
update-classes
]
tri
]
if
;