Hacker News new | ask | show | jobs
by rbanffy 5631 days ago
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.

2 comments

You're quite right, but in all fairness, the following would be a saner interface in php:

    italian_to_spanish("Ciao mondo");
Even boring old C# can do that.
Not true. That's just a compiler trick