On 25 Mar 2011, at 19:06, serialhex wrote:

> ...personally i think it would be nice to be able to define new operators
> (like the aforementioned +?) that way when a situation like this comes up,
> one can simply:
> 
> op_def +?  # maybe? i'm assuming it'd have special syntax...
>  # stuff
> end
> 
> and get on with life, making your code cleaner & simpler.  IDK how well this
> would work or its potential ramifications, but i think it fits into the
> 'flavor' of ruby to be able to do such things (i mean, you can define/change
> damn near *everything else* in the language, why not operators?)
> hex

I agree. In Haskell, for instance, you can make a prefix function into an infix by surrounding it with backticks, e.g.

    plus 1 2

becomes

    1 `plus` 2

Something similar would be helpful on occasion, IMO.


On 25 Mar 2011, at 20:06, Ryan Davis wrote:

> 
> Yeah. Well... I disagree. We really don't need extra magical syntax. I can almost guarantee you that this proposal would get rejected by ruby-core@, but you're free to ask.

I find that a strange argument, applied across the language and a lot of what is regularly used would be binned. Aliases, attributes and method synonyms would all go immediately.

Regards,
Iain