Handbook
Glossary
delete-node ( node deque -- )
Factor handbook
»
The language
»
Collections
»
Deques
Prev:
clear-deque ( deque -- )
Next:
node-value ( node -- value )
Vocabulary
deques
Inputs
node
an
object
deque
a
deque
Outputs
None
Generic word contract
Deletes the node from the deque.
Definition
IN:
deques
GENERIC:
delete-node
( node deque -- )
Methods
USING:
accessors
combinators
deques
dlists
kernel
;
M:
dlist
delete-node
[
{
{
[
2dup
front>>
eq?
]
[
nip
pop-front*
]
}
{
[
2dup
back>>
eq?
]
[
nip
pop-back*
]
}
[
drop
unlink-node
]
}
cond
]
[
drop
f
>>prev
f
>>next
drop
]
2bi
;
USING:
accessors
assocs
deques
kernel
search-deques
;
M:
search-deque
delete-node
[
deque>>
delete-node
]
[
[
node-value
]
[
assoc>>
]
bi*
delete-at
]
2bi
;