Next: , Previous: , Up: deques   [Index]


38.5 Mapping over deques

The following syntactic bindings are exported by the library (vicare containers deques). The syntactic bindings whose name is prefixed with $ are unsafe operations: they do not validate their arguments before accessing them.

Function: deque-map-left dst-deque fun src-deque
Function: $deque-map-left dst-deque fun src-deque

Iterate over all the objects in src-deque, starting from the front side, apply fun to them, push the result of the application in the rear side of dst-deque.

(deque->list
  (deque-map-left (deque) - (deque 0 1 2 3)))
⇒ (0 -1 -2 -3)

The dst-deque argument allows us to build the destination deque with the desired configuration parameters.

Function: deque-map-right dst-deque fun src-deque
Function: $deque-map-right dst-deque fun src-deque

Iterate over all the objects in src-deque, starting from the rear side, apply fun to them, push the result of the application in the front side of dst-deque.

(deque->list
  (deque-map-right (deque) - (deque 0 1 2 3)))
⇒ (0 -1 -2 -3)

The dst-deque argument allows us to build the destination deque with the desired configuration parameters.

Function: deque-map fun deque
Function: $deque-map fun deque

Aliases for deque-map-left and $deque-map-left.

Function: deque-for-each-left fun deque
Function: $deque-for-each-left fun deque

Iterate over all the objects in deque, starting from the front side, and apply fun to them discarding the return value.

Function: deque-for-each-right fun deque
Function: $deque-for-each-right fun deque

Iterate over all the objects in deque, starting from the rear side, and apply fun to them discarding the return value.

Function: deque-for-each fun deque
Function: $deque-for-each fun deque

Aliases for deque-for-each-left and $deque-for-each-left.


Next: , Previous: , Up: deques   [Index]