with-methods ( class generic quot -- ) - Factor Documentation

with-methods ( class generic quot -- )


Vocabulary
generic

Inputs
class a class
generic a generic
quot a quotation with stack effect ( methods -- )


Outputs
None

Word description
Applies a quotation to the generic word's methods hashtable, and regenerates the generic word's definition when the quotation returns.

Notes
Calling this word directly is not necessary in most cases. Higher-level words call it automatically.

Definition
USING: kernel words ;

IN: generic

: with-methods ( class generic quot -- )
[ "methods" word-prop ] prepose [ update-generic ] 2bi ;
inline

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