1lazy-list ( a -- lazy-cons ) (original) (raw)

1lazy-list ( a -- lazy-cons )
Lazy lists » Constructing lazy lists

Prev: lazy-cons ( car cdr -- lazy )
Next: 2lazy-list ( a b -- lazy-cons )

Vocabulary
lists.lazy

Inputs

a a quotation with stack effect ( -- X )

Outputs

lazy-cons a lazy-cons object

Word description
Create a lazy list with 1 element. The element is the result of calling the quotation. The quotation is only called when the list element is requested.

See also
2lazy-list, 3lazy-list

Definition

USING: lists ;

IN: lists.lazy

: 1lazy-list ( a -- lazy-cons ) [ nil ] lazy-cons ;