Handbook
Glossary
car ( cons -- car )
Factor handbook
»
The language
»
Collections
»
Lists
»
The list protocol
Prev:
list
Next:
cdr ( cons -- cdr )
Vocabulary
lists
Inputs
cons
a
list
Outputs
car
the first item in the list
Word description
Returns the first item in the list.
See also
cdr
Definition
IN:
lists
GENERIC:
car
( cons -- car )
Methods
USING:
circular
kernel
lists
sequences
;
M:
circular
car
0
swap
nth
;
USING:
accessors
lists
;
M:
cons-state
car
car>>
;
USING:
accessors
lists
lists.lazy
;
M:
lazy-append
car
list1>>
car
;
USING:
accessors
lists
lists.lazy
;
M:
lazy-concat
car
car>>
car
;
USING:
accessors
lazy
lists
lists.lazy
;
M:
lazy-cons-state
car
car>>
force
;
USING:
accessors
kernel
lists
lists.lazy
lists.lazy.private
;
M:
lazy-filter
car
dup
car-filtered?
[
cons>>
]
[
skip
]
if
car
;
USING:
accessors
lists
lists.lazy
;
M:
lazy-from-by
car
n>>
;
USING:
accessors
combinators
kernel
lists
lists.lazy
;
M:
lazy-io
car
dup
car>>
[
nip
]
[
dup
[
stream>>
]
[
quot>>
]
bi
( stream -- value )
call-effect
[
>>car
]
[
drop
nil
]
if*
]
if*
;
USING:
accessors
combinators
kernel
lists
lists.lazy
;
M:
lazy-map
car
[
cons>>
car
]
[
quot>>
( old -- new )
call-effect
]
bi
;
USING:
accessors
lists
lists.lazy
;
M:
lazy-take
car
cons>>
car
;
USING:
accessors
lists
lists.lazy
;
M:
lazy-until
car
cons>>
car
;
USING:
accessors
lists
lists.lazy
;
M:
lazy-while
car
cons>>
car
;
USING:
accessors
arrays
kernel
lists
lists.lazy
;
M:
lazy-zip
car
[
list1>>
car
]
keep
list2>>
car
2array
;
USING:
lazy
lists
;
M:
lazy
car
force
car
;
USING:
accessors
kernel
lists
lists.lazy
;
M:
memoized-cons
car
dup
car>>
+not-memoized+
eq?
[
dup
original>>
car
[
>>car
drop
]
keep
]
[
car>>
]
if
;
USING:
accessors
kernel
lists
lists.lazy
sequences
;
M:
sequence-cons
car
[
index>>
]
[
seq>>
nth
]
bi
;