On Wednesday, 22 December 2021 at 16:30:06 UTC, data pulverizer
wrote:
On Wednesday, 22 December 2021 at 16:10:42 UTC, Adam D Ruppe
wrote:
So OUTSIDE a function, static foreach() {{ }} is illegal
because a plain {} is illegal outside a function.
But INSIDE a function, static foreach() {{ }} is
On Wednesday, 22 December 2021 at 16:10:42 UTC, Adam D Ruppe
wrote:
So OUTSIDE a function, static foreach() {{ }} is illegal
because a plain {} is illegal outside a function.
But INSIDE a function, static foreach() {{ }} is legal, but it
isn't magic about static foreach - it is just a body wit
On Wednesday, 22 December 2021 at 16:01:49 UTC, rikki cattermole
wrote:
Seems to be working just fine as of 2.098.
```d
import std;
void main()
{
static foreach(Foo; ["Abc", "def"]) {{
string str = Foo;
writeln("Hello D ", str, __VERSION__);
}}
}
```
```
Hello D Abc2098
On 22.12.21 17:01, rikki cattermole wrote:
Anyway, AliasAssign has nothing to do with this. This "trick" creates a
closure aka ``() { ... }``. Thats all its doing.
From the AST dump:
```
import object;
import std;
void main()
{
{
string str = "Abc";
writeln("Hello D ",
On Wednesday, 22 December 2021 at 15:57:29 UTC, data pulverizer
wrote:
I noticed that the double bracket `{{` for scoping `static
foreach` is no longer part of D and it looks like it has been
replaced with
https://dlang.org/changelog/2.098.0.html#AliasAssign
None of these things have
Seems to be working just fine as of 2.098.
```d
import std;
void main()
{
static foreach(Foo; ["Abc", "def"]) {{
string str = Foo;
writeln("Hello D ", str, __VERSION__);
}}
}
```
```
Hello D Abc2098
Hello D def2098
```
Anyway, AliasAssign has nothing to do with this. Thi
Hi All,
I noticed that the double bracket `{{` for scoping `static
foreach` is no longer part of D and it looks like it has been
replaced with
https://dlang.org/changelog/2.098.0.html#AliasAssign. Could
someone confirm this with a link to the DIP and any other tools
that we should be using