From: Tobias Reif Date: 2001-09-04T07:29:22+09:00 Subject: [ruby-talk:20819] Re: RCR: non-bang equivalent to []= Hi Dave, > Being realistic, though, wouldn't you expect > > a[1] = 2 > > to modify the object referenced by 'a'. []= may not appear in a new concept+convention; it could stay like it is, and behave like everyone knows. A new concept+convention may introduce its equivalent. [...]Similarly for 'delete' and > company. Absolutely; there *are* exceptions that make sense. As David Black said: #max, #first, #last sure don't make a copy. What exactly their name is; which characters are appended to their name or not, is just a detail. They probybly wouldn't have both versions. > There _are_ issues with '!', particularly to do with return values > when the receiver isn't changed, but I don't think you should take the > '!' as a part of the semantic content of the method being called. It > really is no more than a hint that something "dangerous" is going on. Any stringent concept plus semantically rich naming convention would help to determine how a method acts in this aspect, thus improving the Principle Of Least Surprise, especially when working with methods out of the thousands of classes and libraries that are and will be written. 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/