www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - why cant function parameters be grouped by type ?

reply "Baz" <bb.temp gmx.com> writes:
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.
Apr 12 2015
next sibling parent "Idan Arye" <GenericNPC gmail.com> writes:
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`?
Apr 12 2015
prev sibling parent ketmar <ketmar ketmar.no-ip.org> writes:
On Sun, 12 Apr 2015 11:49:18 +0000, Baz wrote:

 Is there anything in the grammar that prevents this syntax ?
yes: nameless args. i would like to see 'em burned with napalm, but it=20 seems to be too late to do that...=
Apr 12 2015