classes.algebra classes.union sets quotations assocs combinators
combinators.short-circuit words namespaces continuations classes
fry hints locals
+stack-checker.dependencies
compiler.tree
compiler.tree.builder
compiler.tree.recursive
] if
] [ 2drop undo-inlining ] if ;
+ERROR: bad-splitting class generic ;
+
+:: split-code ( class generic -- quot/f )
+ class generic method :> my-method
+ my-method [ class generic bad-splitting ] unless
+ class generic my-method depends-on-method-is
+ generic dispatch# (picker) :> picker
+ [
+ picker call class instance?
+ [ my-method execute ]
+ [ generic no-method ] if
+ ] ;
+
+:: split-method-call ( class generic -- quot/f )
+ class generic subclass-with-only-method [
+ [ class generic depends-on-single-method ]
+ [ generic split-code ] bi
+ ] [ f ] if* ;
+
: inlining-standard-method ( #call word -- class/f method/f )
dup "methods" word-prop assoc-empty? [ 2drop f f ] [
2dup [ in-d>> length ] [ dispatch# ] bi* <= [ 2drop f f ] [
[ in-d>> <reversed> ] [ [ dispatch# ] keep ] bi*
[ swap nth value-info class>> dup ] dip
- method-for-class
+ { [ method-for-class ] [ split-method-call ] } 2||
] if
] if ;