On Aug 13, 2009, at 2:36 PM, Marnen Laibow-Koser wrote:
>
> Robert Walker wrote:
> [...]
>> Is there really a valid distinction between operators and methods
>> anymore?
>
> Not for all operators in Ruby. In some languages, not for *any*
> operator
>
>> Isn't the syntax essentially "syntactic sugar" allowing for
>> simplified use of some of the methods?
>
> Yup. And if you've ever done BigDecimal arithmetic in Java -- or just
> about anything in Lisp -- you can really appreciate being able to type
>
> x.foo = 1 + 2 * 5
>
> instead of
>
> x.foo=(1.+(2.*(5)))
From Pickaxe, the following are not implemented as methods and thus
cannot be overridden:
&& Logical `and'
|| Logical `or'
.. ... Range (inclusive and
exclusive)
? : Ternary if-then-else
= %= { /= -= += |= &= >>= <<= *= &&= ||= **= Assignment
defined? Check if symbol defined
not Logical negation
or and Logical composition
if unless while until Expression modifiers
begin/end Block expression
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---