Handbook
Glossary
define-reader ( class slot-spec -- )
Factor handbook
»
The language
»
Objects
»
Low-level slot operations
Prev:
slot-named ( name specs -- spec/f )
Next:
define-writer ( class slot-spec -- )
Vocabulary
slots
Inputs
class
a
class
slot-spec
a
slot-spec
Outputs
None
Word description
Defines a reader word to read a slot specified by
slot-spec
.
Notes
Calling this word directly is not necessary in most cases. Higher-level words call it automatically.
Definition
USING:
accessors
combinators
kernel
;
IN:
slots
:
define-reader
( class slot-spec -- )
[
nip
name>>
define-reader-generic
]
[
{
[
drop
]
[
nip
name>>
reader-word
]
[
reader-quot
]
[
nip
reader-props
]
}
2cleave
define-typecheck
]
2bi
;