March 22, 2023
On Wednesday, 22 March 2023 at 20:58:40 UTC, Ali Çehreli wrote:
> On 3/22/23 10:58, Dom Disc wrote:
>
> > After:
> > ```D
> > void fun(
>
> Note: There is no closing parenthesis and a curly brace up there. :)
>
> >     auto t = SomeStruct.init,
> >     auto arr = int[4].init; // if this doesn't work, we
> should fix it
>
> That semicolon suggests you may have missed that the OP is talking about parameter lists. Or maybe not... :)
>
> Ali

Btw it works in parameters list for the array
March 23, 2023
On Wednesday, 22 March 2023 at 20:58:40 UTC, Ali Çehreli wrote:
> Note: There is no closing parenthesis and a curly brace up there. :)
> That semicolon suggests you may have missed that the OP is talking about parameter lists. Or maybe not... :)

Ah, ok. thanks. I've missed that indeed.

So I think we should allow "foo(auto x = 5)" in general. The type of default-parameters should be as unambiguous as the type of variable declarations (with init type).
At least that wouldn't need any new syntax and is self-explaining. Also it should be very easy to implement.
March 24, 2023

On Wednesday, 22 March 2023 at 20:31:47 UTC, John Colvin wrote:

>

No problem, if you submit a DIP

There's a bugzilla issue preapproved by Walter with auto ident = exp syntax:
https://forum.dlang.org/post/mailman.493.1487193825.31550.digitalmars-d-bugs@puremagic.com

>

and then go implement it in the compiler, because afaict that doesn’t work at all at the moment.

There was already a pull request that was rejected before the preapproved status:
https://github.com/dlang/dmd/pull/2270

It allowed ident = exp and storage_class ident = exp. The former should be disallowed - use auto instead.

March 24, 2023

On Friday, 24 March 2023 at 13:50:56 UTC, Nick Treleaven wrote:

>

On Wednesday, 22 March 2023 at 20:31:47 UTC, John Colvin wrote:

>

No problem, if you submit a DIP

There's a bugzilla issue preapproved by Walter with auto ident = exp syntax:
https://forum.dlang.org/post/mailman.493.1487193825.31550.digitalmars-d-bugs@puremagic.com

There is also this to back it up (as Walter's photo is not on the above post):
https://forum.dlang.org/post/1712dc6c-90c2-36d2-5d27-09cfafe25e75@erdani.org

1 2
Next ›   Last »