import std.stdio; void delegate() dg; int x = 3; void main(){ int x = 4; void d(){ writefln(x); } dg = &d; dg(); } writes 4