Forum: Ruby Methods as infix operators WAS: Defending Ruby's OOP

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0a5391b2f3c8aea510ebed66b29998f3?d=identicon&s=25 Sammy Larbi (Guest)
on 2007-05-28 18:11
(Received via mailing list)
John Joyce 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
This topic is locked and can not be replied to.