March 24, 2021
int x = 10;
int y = 20;

void main()
{
    import std.stdio : writeln;

    int x = 5;

    {
        int z;
        z = y / x;
        writeln("Value of z is ", z);
    }

}

// Output: Value of z is 4
March 24, 2021
On Wednesday, 24 March 2021 at 02:06:42 UTC, Leo Custodio wrote:
> [snip]

D uses the inner-most name available when it can. You can ask it to look back at top level with a prefixed .:

z = y / .x; // use x from the top level