On 10/24/07, Bob Hutchison <hutch / recursive.ca> wrote:
>
> On 24-Oct-07, at 9:03 AM, Todd Benson wrote:
>
> >   def dequeue
> >     @list.shift
> >   end
>
> Save yourself some grief, do it this way:
>
> def dequeue
>    tmp = @list[0]
>    @list[0] = nil
>    @list.shift
>    tmp
> end
>
> Cheers,
> Bob

Bob, I can only guess that the grief you are talking about has
something to do with memory management, but I don't see it.

Can someone explain -- with the code above -- why tmp does in fact
_not_ take on NilClass?  I think it would be good info for newbies.

Todd