Handbook
Glossary
pop-front* ( deque -- )
Factor handbook
»
The language
»
Collections
»
Deques
Prev:
push-back* ( obj deque -- node )
Next:
pop-back* ( deque -- )
Vocabulary
deques
Inputs
deque
a
deque
Outputs
None
Generic word contract
Pop the object off the front of the deque.
Notes
This operation is O(1).
Definition
IN:
deques
GENERIC:
pop-front*
( deque -- )
Methods
USING:
accessors
deques
dlists
kernel
;
M:
dlist
pop-front*
[
[
empty-deque
]
unless*
next>>
f
over
set-prev-when
]
change-front
normalize-back
;
USING:
accessors
assocs
deques
kernel
search-deques
;
M:
search-deque
pop-front*
[
deque>>
pop-front
]
[
assoc>>
]
bi
delete-at
;
USING:
accessors
deques
kernel
math
unrolled-lists
unrolled-lists.private
;
M:
unrolled-list
pop-front*
dup
front>>
[
empty-unrolled-list
]
unless*
over
front-pos>>
unroll-factor
1
-
eq?
[
pop-front/new
]
[
pop-front/existing
]
if
;