Created
June 7, 2011 09:28
-
-
Save marijnh/1011949 to your computer and use it in GitHub Desktop.
This file contains 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
tag a { | |
left(int); | |
right(bool); | |
} | |
fn sabotage(@rec(mutable a foo) x) { | |
x.foo = left(0); | |
} | |
fn main() { | |
auto v = @rec(mutable foo = right(true)); | |
auto sabot = bind sabotage(v); | |
alt (v.foo) { | |
case (right(?u)) { | |
sabot(1); | |
log_err u; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment