 : remember-inlining ( word -- )
     history [ swap suffix ] change ;
 
-: inline-word ( #call word -- ? )
-    dup history get memq? [
-        2drop f
+: inline-word-def ( #call word quot -- ? )
+    over history get memq? [
+        3drop f
     ] [
         [
-            dup remember-inlining
-            dupd def>> splicing-nodes >>body
+            swap remember-inlining
+            dupd splicing-nodes >>body
             propagate-body
         ] with-scope
         t
     ] if ;
+
+: inline-word ( #call word -- ? )
+    dup def>> inline-word-def ;
 
 : inline-method-body ( #call word -- ? )
     2dup should-inline? [ inline-word ] [ 2drop f ] if ;

USING: accessors kernel arrays sequences math math.order
math.partial-dispatch generic generic.standard generic.math
classes.algebra classes.union sets quotations assocs combinators
words namespaces continuations
compiler.tree
compiler.tree.builder
compiler.tree.recursive

    {
        { [ dup deferred? ] [ 2drop f ] }
        { [ dup custom-inlining? ] [ inline-custom ] }
        { [ dup \ instance? eq? ] [ inline-instance-check ] }
        { [ dup always-inline-word? ] [ inline-word ] }
        { [ dup standard-generic? ] [ inline-standard-method ] }
        { [ dup math-generic? ] [ inline-math-method ] }
