Handbook
Glossary
cdr ( cons -- cdr )
Factor handbook
»
The language
»
Collections
»
Lists
»
The list protocol
Prev:
car ( cons -- car )
Next:
nil? ( object -- ? )
Vocabulary
lists
Inputs
cons
a
list
Outputs
cdr
a
list
Word description
Returns the tail of the list.
See also
car
Definition
IN:
lists
GENERIC:
cdr
( cons -- cdr )
Methods
USING:
circular
kernel
lists
;
M:
circular
cdr
[
rotate-circular
]
keep
;
USING:
accessors
lists
;
M:
cons-state
cdr
cdr>>
;
USING:
accessors
kernel
lists
lists.lazy
;
M:
lazy-append
cdr
[
list1>>
cdr
]
[
list2>>
]
bi
lappend-lazy
;
USING:
accessors
kernel
lists
lists.lazy
lists.lazy.private
;
M:
lazy-concat
cdr
[
car>>
cdr
]
keep
cdr>>
(lconcat)
;
USING:
accessors
lazy
lists
lists.lazy
;
M:
lazy-cons-state
cdr
cdr>>
force
;
USING:
accessors
kernel
lists
lists.lazy
lists.lazy.private
;
M:
lazy-filter
cdr
dup
car-filtered?
[
[
cons>>
cdr
]
[
quot>>
]
bi
lfilter
]
[
skip
cdr
]
if
;
USING:
accessors
combinators
kernel
lists
lists.lazy
;
M:
lazy-from-by
cdr
[
n>>
]
[
quot>>
]
bi
[
( old -- new )
call-effect
]
keep
lfrom-by
;
USING:
accessors
kernel
lists
lists.lazy
;
M:
lazy-io
cdr
dup
cdr>>
dup
[
nip
]
[
drop
dup
[
stream>>
]
[
quot>>
]
[
car
]
tri
[
[
f
f
]
dip
<lazy-io>
[
>>cdr
drop
]
keep
]
[
3drop
nil
]
if
]
if
;
USING:
accessors
kernel
lists
lists.lazy
;
M:
lazy-map
cdr
[
cons>>
cdr
]
[
quot>>
lmap-lazy
]
bi
;
USING:
accessors
kernel
lists
lists.lazy
math
;
M:
lazy-take
cdr
[
cons>>
cdr
]
[
n>>
1
-
ltake
]
bi
;
USING:
accessors
combinators
kernel
lists
lists.lazy
;
M:
lazy-until
cdr
[
[
cons>>
cdr
]
[
quot>>
]
bi
]
[
[
cons>>
car
]
[
quot>>
]
bi
( elt -- ? )
call-effect
]
bi
[
2drop
nil
]
[
luntil
]
if
;
USING:
accessors
kernel
lists
lists.lazy
;
M:
lazy-while
cdr
[
cons>>
cdr
]
keep
quot>>
lwhile
;
USING:
accessors
kernel
lists
lists.lazy
;
M:
lazy-zip
cdr
[
list1>>
cdr
]
keep
list2>>
cdr
lzip
;
USING:
lazy
lists
;
M:
lazy
cdr
force
cdr
;
USING:
accessors
kernel
lists
lists.lazy
;
M:
memoized-cons
cdr
dup
cdr>>
+not-memoized+
eq?
[
dup
original>>
cdr
[
>>cdr
drop
]
keep
]
[
cdr>>
]
if
;
USING:
accessors
kernel
lists
lists.lazy
math
;
M:
sequence-cons
cdr
[
index>>
1
+
]
[
seq>>
sequence-tail>list
]
bi
;