Yukihiro Matsumoto wrote: > > Hi, > > In message "[ruby-talk:14479] Re: RCR: Array#insert" > on 01/05/01, Shugo Maeda <shugo / ruby-lang.org> writes: > > |At Sat, 28 Apr 2001 19:35:25 +0900, > |Marko Schulz <in6x059 / public.uni-hamburg.de> wrote: > |> I would actually prefer an version that is able to insert more than > |> one element, just like push can add more than one element at the > |> end. So here is my take: > |> > |> > |> class Array > |> def insert(pos, *elem) > |> self[pos,0] = elem > |> self > |> end > |> end > | > |I agree. > > Sounds good. It will be merged into the development branch. > > matz. What about his alternate version that handled negative indices differently? [ruby-talk:14371] further down. http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/14371 Otherwise, the only way to add after the last element would be to use #push. 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