Created
January 4, 2014 08:31
-
-
Save yutopp/8253085 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.stdio; | |
struct A | |
{ | |
void print() | |
{ | |
a.writeln; # a at line 11 | |
} | |
} | |
int a = 72; | |
void main() | |
{ | |
(A()).print; #=> 72 | |
struct A | |
{ | |
void print() | |
{ | |
a.writeln; # a at line 11 | |
} | |
} | |
int a = 42; | |
(A()).print; #=> 72 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.stdio; | |
struct A(T) | |
{ | |
void print() | |
{ | |
a.writeln; | |
} | |
} | |
int a = 72; | |
void main() | |
{ | |
(A!int()).print; #=> 72 | |
struct A(T) | |
{ | |
void print() | |
{ | |
a.writeln; | |
} | |
} | |
int a = 42; | |
(A!int()).print; #=> 42 ←??? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment