why cant function parameters be grouped by type ?

Idan Arye via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Apr 12 06:03:57 PDT 2015


On Sunday, 12 April 2015 at 11:49:19 UTC, Baz wrote:
> Hi,
> while variable declarations work in list:
>
>> uint a,b,c;
>
> function parameters declarations don't:
>
>> void foo(uint a,b,c);
>
> Because of this, function declarations are sometimes super-wide.
> (despite of the fact that: 
> http://www.brainyquote.com/quotes/quotes/a/alanperlis177279.html)
>
> In the previous example, we could imagine that once a type 
> defined, it'd valid until a new one appears (until a 
> "redefinition" / an "override").
>
> Is there anything in the grammar that prevents this syntax ?
>
> Thx.


void foo(int a, b);


Is `b` a second int argument, or is there a user defined type 
named `b` and the second argument is nameless of type `b`?


More information about the Digitalmars-d-learn mailing list