From: "Wayne E. Seguin" Date: 2007-09-12T22:51:27+09:00 Subject: Re: Thoughts on loops and stacks --Apple-Mail-1-844488374 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Sep 11, 2007, at 17:10 , Robert Klemme wrote: > On 11.09.2007 21:01, Todd A. Jacobs wrote: >> I was thinking about some of the design issues in my dice.rb script: >> http://www2.codegnome.org:59321/scripting/showscript.php? >> script=dice.rb >> and one of the major issues is queueing. I'd like to ensure that >> selecting multiple URLs doesn't overwrite the current contents >> from the >> previous X selection, so I was thinking what I needed to do was >> implement a FIFO stack. > Did you try this? >> array = [1,2,3,4,5] => [1, 2, 3, 4, 5] >> array.shift => 1 >> array => [2, 3, 4, 5] >> array << 6 => [2, 3, 4, 5, 6] >> array => [2, 3, 4, 5, 6] >> array.shift => 2 ~Wayne s///g Wayne E. Seguin Sr. Systems Architect & Systems Administrator --Apple-Mail-1-844488374--