On 10/23/07, richard.j.dale / gmail.com <richard.j.dale / gmail.com> wrote:

> Maybe 'enque' and 'deque' could be used as names for methods to put
> items on the front of a Queue and remove items from the back somewhere
> in Ruby - then you wouldn't need push/pop and shift/unshift depending
> on which end of the queue you were operating on.

I like this:

class Array
   alias :enqueue :push
   alias :dequeue :shift
end

Then you get Queue semantics and the start of the queue is the first
element in the Array :-). (you could do enqueue --> unshift, dequeue
--> pop if you rather have the first element of the queue the last in
the array).

Jesus.