Handbook
Glossary
<memoized-cons> ( cons -- memoized-cons )
Lazy lists
ยป
Manipulating lazy lists
Next:
lappend-lazy ( list1 list2 -- result )
Vocabulary
lists
.
lazy
Inputs
cons
a cons object
Outputs
memoized-cons
the resulting memoized-cons object
Word description
Constructs a cons object that wraps an existing cons object. Requests for the car, cdr and nil? will be remembered after the first call, and the previous result returned on subsequent calls.
See also
cons
,
car
,
cdr
,
nil
,
nil?
Definition
USING:
kernel
;
IN:
lists.lazy
:
<memoized-cons>
( cons -- memoized-cons )
+not-memoized+
+not-memoized+
+not-memoized+
memoized-cons
boa
;