[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Initial value for unfold(-right)

This page is part of the web mail archives of SRFI 117 from before July 7th, 2015. The new archives for SRFI 117 contain all messages, not just those from before July 7th, 2015.



On Sun, Jan 11, 2015 at 10:14 PM, Takashi Kato <ktakashi@xxxxxxxxx> wrote:
On 11/01/2015 22:15, Arthur A. Gleckler wrote:
The problem with that is that it's O(N), whereas the optional parameter
allows it to be O(1).  Think of accumulating incoming batches of work.
Each batch could be added to the existing queue without copying.
Maybe I'm misunderstanding but it would cost O(N) if the list of given
queue is copied (that's what John suggested) and my imaginary procedure
list-queue-add-back-all! might only cost O(1) if it wouldn't copy the
list (though there is a procedure which mutates queue's elements so it
should take O(N) to copy for safety).

It seems that there are too many interpretations of this optional parameter, so I withdraw the proposal as too confusing.

This SRFI looks good to me.