callback ( head quot: ( callback-env -- ? ) -- ) (original) (raw)
callback ( head quot: ( callback-env -- ? ) -- )
Vocabulary
logic
Inputs
head | an array |
---|---|
quot | a quotation |
Outputs
None
Word description
Set the quotation to be called. Such quotations take an environment which holds the binding of logic variables, and returns t or f as a result of execution. To retrieve the values of logic variables in the environment, use of or at.
Examples
LOGIC-PRED: N_>_0 { N_>_0 N } [ N of 0 > ] callback
See also
callbacks
Definition
USING: accessors kernel logic.private sequences ;
:: callback ( head quot: ( callback-env -- ? ) -- )
head def>goal :> head-goal head-goal pred>>
[ { head-goal quot } suffix! ] change-defs drop ;