Thread overview |
---|
April 12, 2015 why cant function parameters be grouped by type ? | ||||
---|---|---|---|---|
| ||||
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. |
April 12, 2015 Re: why cant function parameters be grouped by type ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Baz | 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`?
|
April 12, 2015 Re: why cant function parameters be grouped by type ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Baz Attachments: | 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 seems to be too late to do that...
|
Copyright © 1999-2021 by the D Language Foundation