Variadic parameter in MC++ Whidbey : How Could We Design Such a Thing?

Thanks for that answer Stan.

Comments (2)

  1. Yves Dolce says:

    I commented:

    "For example, why this syntax and not

    void Trace1( String^ format, array<Object>^ args … ); which in my eyes, feels (!) more intuitive.

    I’m of course not thinking about the parser and potential grammar conflicts but I’d love to learn."

    Stan answered:

    "Because this would mean something entirely different the ellipsis seems to indicate that fllowing the array [and it does not need to be an Object, of course] any number of arguments can follow. So, this is not viable as a solution … I am sure that is why the ellipsis were put at the front of the array declaration.

    If you want to present an alternative syntax, you need to begin with (a) the array declaration syntax, and (b) some way to indicate that this array is a Param Array … pushing around the ellipsis from this location to the next is not going to really provide you with an appreciation of the design."