2009/8/25 Sarah Allen <sarah / ultrasaurus.com>:
> 7stud -- wrote:
>> Ruby gives you a choice with some methods, like +() and =(), to use a
>> special syntax.  ¨Βπεγιαμ σωξταψεσ αςγοννοξμω λξοχασ Άσωξταγτιγ
>> sugar". What happens is that the "sugared syntax" is converted into
>> the normal method call, so:
>>
>> 1 + 2  ¨Βεγονεσ ±®«¨²©
>>
>> and
>>
>> obj.x = 10 becomes obj.x=(10) where the method name is 'x=')
>
> So, where might I find a list of the special sugary methods?

There is a list in the printed edition of the Pickaxe IIRC.

> and may I
> define my own?  ¨Β λξοχ γαοφεςςιδε α βυγουμναλε ος ζο> be sent to an object with syntax such as 4 foo 4 or "test"΅¬"this" ? I
> don't know that I would want to, but I am curious)

You cannot as that would mean changing of the language's syntax.

Kind regards

robert


-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/