 : 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 ;

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

    [ dup 1array ] [ "custom-inlining" word-prop ] bi* with-datastack
    first object swap eliminate-dispatch ;

: inline-instance-check ( #call word -- ? )
    over in-d>> second value-info literal>> dup class?
    [ "predicate" word-prop '[ drop @ ] inline-word-def ] [ 3drop f ] if ;

: do-inlining ( #call word -- ? )
    #! If the generic was defined in an outer compilation unit,
    #! then it doesn't have a definition yet; the definition
