no queue class in base?

Brian Rice water at tunes.org
Thu Nov 3 20:46:42 UTC 2005


It still doesn't have the right performance characteristics for a  
Queue: growing at one end and hopefully then shrinking at the other  
end isn't as useful as trying to hold on to the same size Array  
contents and shifting the contents around as needed or using loop- 
around first-index and last-index semantics. Slate has such a version  
in src/lib/queue.slate which could probably be ported back pretty  
easily. We also have a derived RingBuffer which "eats" one end when  
the other end expands too much - useful in some limited circumstances.

On Nov 3, 2005, at 12:24 PM, Josh Gargus wrote:

> What about OrderedCollection?  It has the methods #removeFirst  
> and#addLast:, which should be all you need for a queue.
>
> Or, if you prefer, #addFirst: and #removeLast  :-)
>
> Josh
>
>
> On Nov 3, 2005, at 12:12 PM, Martin Kuball wrote:
>
>> Hi!
>>
>> I'm looking for a queue class in squeak. The only class I found is
>> SharedQueue. But I don't need synchronization. Sure, if there is
>> really none I could write one in minutes. But I wonder if it makes
>> sense to add such an elementary data structure to the base collection
>> stuff.
>>
>> Martin
>>
>

--
-Brian




More information about the Squeak-dev mailing list