(ideque-fold proc nil ideque ...)

(ideque-fold-right proc nil ideque ...)

Invokes proc on the corresponding elements of ideques in forward/reverse order, passing the result of the previous invocation as a second argument. For the first invocation, nil is used as the second argument. Returns the result of the last invocation, or nil if there was no invocation. Terminates when any ideque is finished. Takes O(n) time.


Should “second argument” be “last argument” ?

(ideque-reverse ideque)

Returns an ideque containing the elements of ideque in reverse order. Takes O(n) time.


Can’t it be proven that any implementation that supports the O(1) requirements on -front,-back,-remove-*,-add-*, should be able to support ideque-reverse in O(1) time trivially?