Handbook
Glossary
lcut ( list index -- before after )
Factor handbook
»
The language
»
Collections
»
Lists
»
Manipulating lists
Prev:
lappend ( list1 list2 -- newlist )
Vocabulary
lists
Inputs
list
a
list
index
an
integer
Outputs
before
a
cons
after
a
cons
Word description
Analogous to
cut
, this word cuts a list into two pieces at the given index.
Definition
USING:
kernel
math
;
IN:
lists
:
lcut
( list index -- before after )
[
nil
]
dip
[
[
unswons
]
dip
cons
]
times
lreverse
swap
;