lists: Fix lists
parent
90cde3fde9
commit
542e7cd95e
|
@ -85,7 +85,7 @@ HELP: <memoized-cons>
|
|||
|
||||
HELP: lazy-map
|
||||
{ $values { "list" "a cons object" } { "quot" { $quotation "( obj -- X )" } } { "result" "resulting cons object" } }
|
||||
{ $description "Perform a similar functionality to that of the " { $link map } " word, but in a lazy manner. No evaluation of the list elements occurs initially but a " { $link <lazy-map> } " object is returned which conforms to the list protocol. Calling " { $link car } ", " { $link cdr } " or " { $link nil? } " on this will evaluate elements as required." } ;
|
||||
{ $description "Perform a similar functionality to that of the " { $link map } " word, but in a lazy manner. No evaluation of the list elements occurs initially but a " { $link <lazy-map-state> } " object is returned which conforms to the list protocol. Calling " { $link car } ", " { $link cdr } " or " { $link nil? } " on this will evaluate elements as required." } ;
|
||||
|
||||
HELP: ltake
|
||||
{ $values { "n" "a non negative integer" } { "list" "a cons object" } { "result" "resulting cons object" } }
|
||||
|
|
|
@ -18,7 +18,7 @@ TUPLE: lazy-cons-state car cdr ;
|
|||
|
||||
: lazy-cons ( car cdr -- promise )
|
||||
[ T{ promise f f t f } clone ] 2dip
|
||||
[ promise ] bi@ \ lazy-cons-state boa
|
||||
[ <promise> ] bi@ \ lazy-cons-state boa
|
||||
>>value ;
|
||||
|
||||
M: lazy-cons-state car ( lazy-cons -- car )
|
||||
|
|
|
@ -63,7 +63,7 @@ ARTICLE: "lists-manipulation" "Manipulating lists"
|
|||
} ;
|
||||
|
||||
HELP: cons
|
||||
{ $values { "car" "the head of the list cell" } { "cdr" "the tail of the list cell" } { "cons" list } }
|
||||
{ $values { "car" "the head of the list cell" } { "cdr" "the tail of the list cell" } { "cons-state" list } }
|
||||
{ $description "Constructs a cons cell." } ;
|
||||
|
||||
HELP: swons
|
||||
|
|
Loading…
Reference in New Issue