Bj <bjst01 / student.bth.se> wrote:
> class Array
>        def set_element(a, b)
>                self[a] = b
>                self
>        end
> end
> 
> altering the basic []= behavior seems IMO like a pretty bad idea.

Having a hash argument would be prettier - then you can say
a.set({1=>6, 2=>5, 3=>-1}).sort

martin