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

Re: queue->list, list->queue

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.



Shiro Kawai scripsit:

>   queue-list instead of queue->list

I actually had that name in an earlier draft, and I agree that it's better.
The same should be done with queue-first-last, I think.

>   make-queue-with-list instead of list->queue

This seems like a pretty good name, or perhaps make-queue-using-list.

>     It's a constructor with special initial value.
> 
> If we have queue->list and list->queue, I'd like them to copy the
> storage, even if those can be trivial to implement:

>    (define (queue->list q) (queue-list (queue-copy q)))
>    (define (list->queue l) (apply queue l))

I guess this makes sense, although I want to avoid `apply` because it is
limited in arguments on many Schemes.

> On a side note, don't we want dequeue-all! operation? SLIB and
> Gauche has it; for the name consistency, we can name it like
> queue-remove-all! or something.

Good idea.  I'll add it.

-- 
John Cowan          http://www.ccil.org/~cowan        cowan@xxxxxxxx
Even a refrigerator can conform to the XML Infoset, as long as it has
a door sticker saying "No information items inside".  --Eve Maler