My own Smalltalk library (and yes, I've tried to put it on github, Idon't know what I'm doing wrong)
includes Deque and BoundedDeque, both descendants of Collection.
Using addLast/removeLast gives you a stack (use #last for peeking)
Using addLast/removeFirst gives you a queue. (use #first for peeking)
(1) I am puzzled why there are separate FIFO and LIFO classes rather
than a single BoundedDeque.
-- This has implications for performance.
(2) I am puzzled why #withCapacity: is used rather than #new:,
familiar from OrderedCollection.
-- These two points together make it hard to just swap
OrderedCollection and ?IFOBuffer.
(3) I am puzzled why #clear is used instead of the familiar #removeAll.
-- See note on question 2.
(4) I am extremely puzzled why ALL, like ALL, of the internals of the
data structure are exposed.
Did encapsulation fall out of favour and I didn't get the memo?
(5) It looks as though calling #capacity: at the wrong time can
destroy the integrity of one of
these containers, but there is nothing sayiing "don't do that".
(6) I am puzzled that they are not Collections.