Hi --

On Tue, 22 Jul 2008, Robert Dober wrote:

> On Mon, Jul 21, 2008 at 6:58 PM, David A. Black <dblack / rubypal.com> wrote:
>> On Tue, 22 Jul 2008, Robert Dober wrote:
>>
>>> On Mon, Jul 21, 2008 at 5:18 PM, David A. Black <dblack / rubypal.com>
>>> wrote:
>>> <snip>
>>>>
>>>> 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 <space> ?
>>
> 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.

There would be, though. dup! would be entirely additional. That was my
idea, at least. Jim's point about dup with the self's included being
safer is interesting.

> 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!!!

We did share it -- just drifted back in at slightly different times
:-) I'm sneaking time from class so have to be terse. Later.


David

> Cheers
> Robert
>

-- 
Rails training from David A. Black and Ruby Power and Light:
     Intro to Ruby on Rails  July 21-24      Edison, NJ
  *  Advancing With Rails    August 18-21    Edison, NJ
  * Co-taught by D.A. Black and Erik Kastner
See http://www.rubypal.com for details and updates!