Handbook
Glossary
peek-back* ( deque -- obj ? )
Vocabulary
deques
Inputs
deque
a
deque
Outputs
obj
an
object
?
a
boolean
Generic word contract
Returns the object at the back of the deque, and a boolean indicating if an object was found.
Definition
IN:
deques
GENERIC:
peek-back*
( deque -- obj ? )
Methods
USING:
accessors
deques
dlists
kernel
;
M:
dlist
peek-back*
back>>
[
obj>>
t
]
[
f
f
]
if*
;
USING:
accessors
deques
search-deques
;
M:
search-deque
peek-back*
deque>>
peek-back*
;
USING:
accessors
deques
kernel
math
sequences.private
unrolled-lists
;
M:
unrolled-list
peek-back*
dup
back>>
[
[
back-pos>>
1
-
]
dip
data>>
nth-unsafe
t
]
[
drop
f
f
]
if*
;