Hi --

On Tue, 4 Dec 2007, Marc Heiler wrote:

>> just means that the whole thing
>> becomes method-name soup and has *no* meaning.
>
> That is not true. I agree that it should not be used
> in other ways than how pretty everyone else uses it.
>
> However, it does not have *no* meaning anymore, it
> simply has a *different* meaning now.

Not that I've heard. I'll defer to Matz on that one.

> If you want to use it (i.e define this different meaning) and how
> you want to use it, is up to you - for example, you could do
> something like:
>
>  def nuke!
>    FileUtils.rm_rf /playing_games_during_worktime # boss coming in!
>  end
>
> And you would still be aware that the method does
> something dangerous.

Yes, as I said before, we can all do whatever we want with !, and end
up with no convention and no pattern and therefore no meaning. If we
all invent new meanings for it, then it has none, in the sense that
when I see it, I won't know what it means.

The parser will certainly let you do it.  I just have not seen any
evidence that anyone has any ideas on this that are remotely as good
as Matz's. So I've never understood what the temptation is to
improvise new meanings for it.

> I used to do this years ago, until I later found out
> I hated to be surprised by methods with ! which
> behave differently ;-)

But that's the point -- the ! *tells* you that they behave
differently from their "non-dangerous" counterparts. That's the
ingenuity of it.


David

-- 
Upcoming training by David A. Black/Ruby Power and Light, LLC:
    * Intro to Rails, London, UK, December 3-6 (by Skills Matter)
See http://www.rubypal.com for details and 2008 announcements!