Wesley J Landaker wrote:
> ...
> Array.insert certainly isn't documented in the reference at
> rubycentral.com, however. If this is a new feature, you can always just
> add it to the old versions yourself. It's certainly not a subclass or
> anything, but the following might be good enough if you want just to be
> hidden from the unwieldy syntax:
> 
> class Array
>   def insert(pos, data)
>      self[pos,0] = data;
>   end
> end
> 
> You can now do Array.insert(pos, data) to insert 'data' at 'pos'. =)
> 

I am expecting that the new #insert would
perform "insert at" instead of "instead before".

(Based on past discussions. Otherwise, the only
way to 'insert' at the very end would be to
use another method, like #push or #<<)

Given: arr=[1,2,3], please compare 
the new: 
   arr.insert(-1,"end") 
with: 
   arr[-1,0] = "before end"



Guy N. Hurst




-- 
HurstLinks Web Development    http://www.hurstlinks.com/
Norfolk, VA  23510            (757)623-9688 FAX 623-0433
PHP/MySQL - Ruby/Perl - HTML/Javascript