[Prototype-core] Array.insert

2008-03-27 Thread koozdra
I propose the addition of Array.insert(index, insertee [,...]). This method would would be like Ruby's insert. "Inserts the given values before the element with the given index" - http://www.ruby-doc.org/core/classes/Array.html#M002195 var a = ['a','b','c','d'] a.insert(2, 33) --> ['a','b',33,'

[Prototype-core] Array.insert

2008-03-27 Thread koozdra
I propose the addition of Array.insert(index, insertee [,...]). This method would would be like Ruby's insert. "Inserts the given values before the element with the given index" - http://www.ruby-doc.org/core/classes/Array.html#M002195 var a = ['a','b','c','d'] a.insert(2, 33) --> ['a','b',33,'

[Prototype-core] Re: Array.insert

2008-03-28 Thread koozdra
t;, 2, 3, 4] [1, 2, 3, 4, nil, nil, nil, nil, nil, nil, "one", "two"] when the index is negative and of greater length than the array, ruby throws an index out of bounds exception. On Mar 27, 4:06 pm, Ken Snyder <[EMAIL PROTECTED]> wrote: > koozdra wrote: > > I pro

[Prototype-core] Re: Array.insert

2008-03-28 Thread koozdra
Thanks Ken that looks great. What is the next step? Can this change make into the next version of prototype? - Dimitri On Mar 28, 12:07 pm, Ken Snyder <[EMAIL PROTECTED]> wrote: > koozdra wrote: > > Thanks for the quick reply. > > > I ran some tests in ruby: >