Inline imports redivivus
bauss
jj_1337 at live.dk
Tue Mar 15 10:25:54 UTC 2022
On Sunday, 13 March 2022 at 12:47:05 UTC, Tejas wrote:
> On Sunday, 13 March 2022 at 08:37:15 UTC, Dom DiSc wrote:
>> On Sunday, 13 March 2022 at 08:23:52 UTC, Dom DiSc wrote:
>>> So any new feature is here totally superfluous IMHO.
>>
>> And btw. foreach doesn't even introduce a new scope, so you
>> can't get your import more local than in my version, no matter
>> what new syntax you invent.
>
> `foreach` **does** introduce a new scope
>
> I believe it is `static foreach` that **doesn't** introduce a
> new scope(hence why you see `static foreach(){{ /*code/* }}`
> style code sometimes
Would be nice if we could attribute static foreach like this
instead:
```d
scope static foreach (...) { ... }
or
static foreach (...) scope { ... }
```
Would've been much cleaner.
More information about the Digitalmars-d
mailing list