On Thursday, 14 April 2022 at 08:55:25 UTC, Chris Katko wrote:
[...]
It appears the nested function's variable capture depends on
forward declaration (the right term?). Whereas, I was under the
impression most/all of D worked on a multiple pass compilation
so the order of declarations
On Thursday, 14 April 2022 at 08:55:25 UTC, Chris Katko wrote:
I imagine this is a really odd edge case but it's piqued my
interest.
Consider this:
```d
void main() {
void foo() { initRuntimeState(i); }
foo();
if(!modifyRutimeState()) return;
int i = getRandomValue();
i =
On Thursday, 14 April 2022 at 08:55:25 UTC, Chris Katko wrote:
Using DMD. v2.098-beta-2
Not sure if right terminology. But I just wrote a nested
function that uses a variable outside its body. The capture
(right term?) is obvious where the invocation is. However, I
have to move the
Using DMD. v2.098-beta-2
Not sure if right terminology. But I just wrote a nested function
that uses a variable outside its body. The capture (right term?)
is obvious where the invocation is. However, I have to move the
declaration of the variable to above the nested function for it
to