Handbook
Glossary
deque-empty? ( deque -- ? )
Factor handbook
»
The language
»
Collections
»
Deques
Prev:
peek-back ( deque -- obj )
Next:
deque-member? ( value deque -- ? )
Vocabulary
deques
Inputs
deque
a
deque
Outputs
?
a
boolean
Generic word contract
Returns true if a deque is empty.
Notes
This operation is O(1).
Examples
USING: deques prettyprint unrolled-lists ; <unrolled-list> deque-empty? .
t
Definition
IN:
deques
GENERIC:
deque-empty?
( deque -- ? )
Methods
USING:
accessors
deques
dlists
kernel
;
M:
dlist
deque-empty?
front>>
not
;
inline
USING:
accessors
deques
search-deques
;
M:
search-deque
deque-empty?
deque>>
deque-empty?
;
USING:
accessors
deques
kernel
unrolled-lists
;
M:
unrolled-list
deque-empty?
dup
[
front>>
]
[
back>>
]
bi
dup
[
eq?
[
[
front-pos>>
]
[
back-pos>>
]
bi
eq?
]
[
drop
f
]
if
]
[
3drop
t
]
if
;