[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:44 AM, Takashi Kato <ktakashi@xxxxxxxxx> wrote:
 
It's just my feeling that unfold related procedure should return a
container only contains the values given mapper procedure returned.
I agree with that it's not an error in the API. However it might be
clear if users could write something like the following (again it's
just my preference):

(list-queue-add-back-all! (list-queue-unfold ...) initial)

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.

I'm not adamant about this proposal, but it seems so simple and adds meaningful capability efficiently, so I thought I'd suggest it.