News for hackers. Stuff that matters.
Re:"this gem is awesome".to_spanish # = "esta joya es impres... by rbanffy on Wednesday January 12, 2011 @05:44AM (#2095665)
I think your example demonstrates very well why one would yearn for Ruby. The ability to give an extra method to a base class allows you to build very expressive code.

edit: and, BTW, the to_spanish method is not defined in the https://github.com/jimmycuadra/to_lang/blob/master/lib/to_la... module.

Re:"this gem is awesome".to_spanish # = "esta joya es impres... by troels on Wednesday January 12, 2011 @10:03AM (#2096323)
You're quite right, but in all fairness, the following would be a saner interface in php:

    italian_to_spanish("Ciao mondo");
Re:"this gem is awesome".to_spanish # = "esta joya es impres... by arethuza on Wednesday January 12, 2011 @07:00AM (#2095856)
Even boring old C# can do that.
Re:"this gem is awesome".to_spanish # = "esta joya es impres... by ryanpetrich on Wednesday January 12, 2011 @11:45AM (#2096705)
Not true. That's just a compiler trick