[MacRuby-devel] Method calls with variable unnamed arguments after the pseudo-hash part of the selector

Caio Chassot lists at caiochassot.com
Sun Oct 10 12:08:35 PDT 2010


On 2010-10-10, at 15:53 , Caius Durling wrote:
> 
>> Now, the interesting part here is the ", ..." at the end. It takes variable arguments at the end that work as formatting arguments for informativeText, eg. sprintf(informativeText, ...).
> 
> Does it work if you pass an array in as the last argument? That's my assumption upon encountering it and trying to use it.

Do you mean:

  … informativeTextWithFormat:"… %d", [1]

or 

  … informativeTextWithFormat:["… %d", 1]


Either way, it doesn't work, and if it did, it would have ambiguous interpretations.

Mind it that my original example causes a parsing error during file load.

I guess there's no special parsing for Objective-C-style method calls, it just parses as a method call with a trailing hash argument, and decides if this is a Objective-C-style method call during runtime.



More information about the MacRuby-devel mailing list