From: Tobias Reif Date: 2001-09-02T02:45:04+09:00 Subject: [ruby-talk:20678] Re: RCR: non-bang equivalent to []= Hi David, >>[]= is bang; >>so >>a version of []= that doesn't modify the receiver >>would be cool. >> > I'm sorry -- I don't understand. What exactly is supposed to happen? > > a = [1,2,3,4] > a.non_bang_set(0) = 100 > a # => [1,2,3,4] Would the following make sense? The exact syntax doesn't matter to me, i just would like to get a non-bang []= Array#set_at a = ["a", "b", "c"] a.set_at 0,"x" -> ["x", "b", "c"] a -> ["a", "b", "c"] Array#set_at! a = ["a", "b", "c"] a.set_at! 0,"x" -> ["x", "b", "c"] a -> ["x", "b", "c"] Tobi -- Tobias Reif http://www.pinkjuice.com/myDigitalProfile.xhtml go_to('www.ruby-lang.org').get(ruby).play.create.have_fun http://www.pinkjuice.com/ruby/