DLang Notes and Examples
← prev | next →     Top-level ToC     /scoping.html     (printable version)

File scope == module scope. These are your “globals”.

Anything declared at module scope is visible anywhere in the module.

Anything declared in function or block scope is visible in that scope and only after the declaration.

    // Make your own nested scopes like this.

Shadowing: locals can shadow globals, but not other locals.

Variables can be declared static … (? XXX)