Handbook
Glossary
llength ( list -- n )
Factor handbook
»
The language
»
Collections
»
Lists
»
Manipulating lists
Prev:
cadr ( list -- elt )
Next:
lreverse ( list -- newlist )
Vocabulary
lists
Inputs
list
a
list
Outputs
n
a non-negative integer
Word description
Outputs the length of the list. This should not be called on an infinite list.
See also
lnth
,
cons
,
car
,
cdr
Definition
USING:
kernel
math
;
IN:
lists
:
llength
( list -- n )
0
[
drop
1
+
]
foldl
;