Methods as infix operators WAS: Defending Ruby's OOP


#1

John J. wrote, On 5/15/2007 4:21 PM:

components (that can be more logically represented as objects), then why
Or even ‘occasionally’ or ‘usually’ for weighted randomness.
This is one of Ruby’s biggest strengths, its expressiveness in a very
natural way.

Once it has got the native unicode thing happening, it will be
possible to begin to write Ruby in languages other than English!
Even in Japanese (which would by its grammar, make a very good
programming language)

Some abstraction is bad because it continues to slow things down, but
processing power is still increasing, while human limits are pretty
constant.

I like this idea. I was thinking

when a==1 someCode

is quite easy, but we need infix on methods to do

somecode when a==1

This isn’t the first time I’ve wished we could have methods acting as
infix operators. Anyone else up for that, and are there any plans to
add it to Ruby? Assuming there is a way to do it that wouldn’t muck up
everything else syntactically, would such a feature be desired and have
a possibility of being accepted into the language if someone were to
code it?

Regards,
Sam