On Sunday 03 November 2002 3:09 pm, Austin Ziegler wrote:
> On Mon, 4 Nov 2002 05:42:37 +0900, Enric Lafont wrote:
<snip>
> >
> > OK, if you have a:
> >   def += (anArgument)
> >       return (self + anArgument)
> >   end
> >
> > You will have exactly the same behaviour you have know, whitout
> > any trick
>
> The problem, of course, is that I can now do:
>
>   def +=(anArgument)
>     return (self - anArgument)
>   end
>
> This subverts the whole point of +=.

Of course it does.  But you can shoot yourself in the foot with every method 
you write.  This is not a problem unique to Smalltalk.  All user written code 
can have bugs.

<snip>
> ? Also, your definition of ++ with an argument makes no sense.

Only because you do not know Smalltalk and cannot even conceive of "++" being 
a message to an object.

>
> > And you have NOW for free a pre-increment and a post increment.
> > This tries to explain the POWER of the every call is a method
>
> Really, though, it doesn't explain it. It explains why you think
> that Ruby should have += as a separate method and that it should
> have ++/-- operators (even as methods), but it's not clear why you
> think that this demonstrates "every call is a method."

He's thinking in Smalltalk.  You're thinking in Ruby.

<snip>
> I don't think that it's necessary to require declaration.
>

Of course it's not necessary.  He is simply expressing his opinion that for 
him it is desirable.
<snip>

Austin, I think that there has been a serious misunderstanding.  Ruby is not 
under attack.  And therefore it does not need your defense.  Enric is simply 
coming to Ruby from a different environment than the one you came from. (I am 
assuming Ruby was not your first language).  And he is therefore simply 
trying to make sense of his new surroundings.  

Nor am I attacking Ruby.  I like Ruby.  I suspect that if you were to expend 
the effort to actually learn Smalltalk you would be delighted at how much it 
shares with Ruby. (once you got over your irrational fear of new syntax :-)

-- 
"I invented the term Object-Oriented, and I can 
tell you I did not have C++ in mind."
                                            -Alan Kay