From: Robert Dober Date: 2008-07-22T04:47:55+09:00 Subject: [ruby-core:17904] Re: duping the NilClass On Mon, Jul 21, 2008 at 6:58 PM, David A. Black wrote: > On Tue, 22 Jul 2008, Robert Dober wrote: > >> On Mon, Jul 21, 2008 at 5:18 PM, David A. Black >> wrote: >> >>> >>> I'm afraid I don't follow that at all. What does it have to do with >>> other ! methods? >> >> Well I interpreted your statement as follows: >> dup is a bad name for Symbol or NilClass as it does not really create >> a new symbol or nil >> thus I call it dup! >> By extension that would mean that e.g. >> gsub! is called gsub! because it does not really gsub >> >> Did I read you incorrectly so far? > > Yes. There's no general "___ does not really ___" rule. The only > general rule about ! methods is the idea of "danger", which can take > many forms. > >> There is already some disagreement about the ! suffix so far, your new >> interpretation of ! meaning dangerous > > It's absolutely not new; Matz has always characterized it that way > ("dangerous"). > >> in the sense that it does something slightly different of what might >> be expected might add to the confusion of >> what ! should mean. >> IMHO it should mean a modifying version of a non modifying version of >> a method. But there is not much agreement on this :(. > > There's been a lot of misunderstanding and second-guessing of Matz, > but he's always been consistent in his description. > >> However there seems agreement that xxx! is a more "dangerous" version >> of xxx and in our case there would >> be dup! but no dup for e.g. NilClass. >> >> Are there other classes, modules, singletons with an xxx! without an >> xxx ? > I do not want to bother this list with my limited ability of expressing myself in English. Obviously I am quite incompetent to say what I want to say, unless you are playing tricks on me David, but I guess you would not do this. Believe me, your replies do not at all fit what I wanted to say, just let us forget (can we discuss this in French, well actually they do not understand me much lately either) ... :( > No; ! methods only make sense in pairs with non-! methods. See my blog > post (cited earlier). Unfortunately, there's a trend toward sticking ! > on methods that aren't in pairs. It makes it meaningless. This is exactly what I said though, your idea would break this rule as there would be NilClass#dup! but no NilClass#dup. Maybe this of my many observations in this thread can be considered useful at least? > Must go -- my students are back from lunch :-) Hey you are lucky, here in France, an instructor is supposed to share lunch with her class!!! Cheers Robert