views:

73

answers:

1

Just wondering if it is possible, by some loophole, to define a method name that ends in a colon. The purpose it to make things look like this:

mymethod: arg1,arg2,arg3
+5  A: 

It is technically possible to define a method with that name, but you can't call it like that because of syntax rules. (The colon is considered a different token.) You would have to do send('mymethod:', args), which defeats the purpose.

mckeed
Sometimes it is better to go for an external DSL than trying to do too perverted things with your language.
Gabriel Ščerbák