Handbook
Glossary
define-predicate-class ( class superclass definition -- )
Factor handbook
»
The language
»
Objects
»
Classes
»
Predicate classes
Prev:
PREDICATE:
Next:
predicate-class
Vocabulary
classes
.
predicate
Inputs
class
a
class
superclass
a
class
definition
a
quotation
with stack effect
( superclass -- ? )
Outputs
None
Word description
Defines a predicate class. This is the run time equivalent of
PREDICATE:
.
Notes
This word must be called from inside
with-compilation-unit
.
Side effects
Modifies
class
See also
predicate-class
,
PREDICATE:
Definition
USING:
classes
classes.predicate.private
classes.private
kernel
words
;
IN:
classes.predicate
:
define-predicate-class
( class superclass definition -- )
[
drop
f
f
predicate-class
define-class
]
[
nip
"predicate-definition"
set-word-prop
]
[
2drop
[
dup
predicate-quot
define-predicate
]
[
update-classes
]
bi
]
3tri
;