unknown-macro-input ( macro -- * )
Factor handbook » The language » Stack effect checking » Stack checker errors

Prev:do-not-compile ( word -- * )
Next:bad-macro-input ( macro -- * )


Vocabulary
stack-checker.errors

Error description
Thrown when inference encounters a combinator or macro being applied to an input parameter of a non-inline word. The word needs to be declared inline before its callers can compile and run. See Combinator stack effects and Stack effect checking escape hatches for details.

Examples
In this example, the words being defined cannot be called, because they fail to compile with a unknown-macro-input error:
: bad-example ( quot -- ) [ call ] [ call ] bi ; : usage ( -- ) 10 [ 2 * ] bad-example . ;

One fix is to declare the combinator as inline:
: good-example ( quot -- ) [ call ] [ call ] bi ; inline : usage ( -- ) 10 [ 2 * ] good-example . ;

Another fix is to use call(:
: good-example ( quot -- ) [ call( x -- y ) ] [ call( x -- y ) ] bi ; : usage ( -- ) 10 [ 2 * ] good-example . ;


Definition


Methods

M: unknown-macro-input summary
macro>> name>> "Cannot apply “"
"” to an input parameter of a non-inline word" surround ;