Superators: Add new operators to Ruby
I know there's going to be some controversy around this clever piece of code by Jay Phillips. He's developed "Superators", a library that finally makes it easy to create new operators within Ruby that look like line noise. Always wanted a "-~+~-" or "===~-+~++" operator? Now it's within your grasp! As Aleks Clark says: "Job security and spiffy DSL construction in one neat package."
August 31, 2007 at 12:48 am
I like it. We'll finaly be able to increment integers like i++.
(Not that it's that hard to do i+=1)
August 31, 2007 at 1:57 pm
Actually, superators are still binary operations, so the unary increment/decrement operators still won't work (I tried).
August 31, 2007 at 2:00 pm
Ok, now this is silly. It sounds very useful, but this is exactly the kind of thing developers love to abuse. (I say this as I download it. ;-)
August 31, 2007 at 7:57 pm
Yeah, it turns out this is written in pure Ruby (no C), so it doesn't actually *add* operators, it just reuses the existing ones in a very very interesting way.
September 18, 2007 at 11:56 am
What's all i++? I already have i.next or i.upto. I think somebody miss the point of ruby language...