slurp-deque ( ... deque quot: ( ... obj -- ... ) -- ... )
Factor handbook » The language » Collections » Deques

Prev:pop-back ( deque -- obj )


Vocabulary
deques

Inputs
dequea deque
quota quotation with stack effect ( ... obj -- ... )


Outputs
None

Word description
Pops off the back element of the deque and calls the quotation in a loop until the deque is empty.

Examples
USING: deques dlists io kernel ; { "one" "two" "three" } <hashed-dlist> [ push-all-front ] keep [ print ] slurp-deque
one two three


Definition


: slurp-deque ( ... deque quot: ( ... obj -- ... ) -- ... )
[ drop [ deque-empty? ] curry ]
[ [ [ pop-back ] curry ] dip compose ] 2bi until ; inline