factor/libs/lazy-lists/lazy.facts

14 lines
664 B
Plaintext

! Copyright (C) 2006 Chris Double.
! See http://factorcode.org/license.txt for BSD license.
USING: help lazy-lists ;
HELP: LAZY:
{ $syntax "LAZY: word definition... ;" }
{ $values { "word" "a new word to define" } { "definition" "a word definition" } }
{ $description "Creates a lazy word in the current vocabulary. When executed the word will return a " { $link <promise> } " that when forced, executes the word definition. Any values on the stack that are required by the word definition are captured along with the promise." }
{ $examples
{ $example "LAZY: my-add ( a b -- c ) + ;\n1 2 my-add force ." }
}
{ $see-also force promise-with promise-with2 } ;