reader-quot ( class slot-spec -- quot ) - Factor Documentation

reader-quot ( class slot-spec -- quot )


Vocabulary
slots

Inputs
class an object
slot-spec an object


Outputs
quot an object


Definition
IN: slots

GENERIC#: reader-quot 1 ( class slot-spec -- quot )


Methods
USING: accessors arrays kernel kernel.private slots
slots.private words ;

M: object reader-quot
nip [ offset>> [ slot ] curry ] [ class>> ] bi
dup object bootstrap-word eq?
[ drop ] [ 1array [ declare ] curry compose ] if ;


USING: accessors arrays classes.struct classes.struct.private
kernel sequences slots specialized-arrays ;

M: struct-class reader-quot
dup type>> array?
[ dup type>> first define-array-vocab drop ] when nip
[ read-struct-slot ] curry ;

AltStyle によって変換されたページ (->オリジナル) /