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

**URL:** <https://www.ruby-forum.com/t/methods-as-infix-operators-was-defending-rubys-oop/105305>\
**Category:** Ruby\
**Created:** [May 28, 2007, 6:11pm UTC](https://www.ruby-forum.com/t/methods-as-infix-operators-was-defending-rubys-oop/105305 "2007-05-28T18:11:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sammy\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90ced4/32.png) [@Sammy\_L](https://www.ruby-forum.com/u/Sammy_L)\
**Post date:** [May 28, 2007, 6:11pm UTC](https://www.ruby-forum.com/t/methods-as-infix-operators-was-defending-rubys-oop/105305/1 "2007-05-28T18:11:42Z")

</div>

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
