method-for-object ( obj word -- method )


Vocabulary
generic.single

Definition
USING: classes classes.algebra generic kernel sequences words ;

IN: generic.single

: method-for-object ( obj word -- method )
[
[
method-classes [ instance? ] with filter
smallest-class
] keep ?lookup-method
] [ "default-method" word-prop ] bi or ;