http://d.puremagic.com/issues/show_bug.cgi?id=596
--- Comment #10 from [email protected] 2013-03-03 04:24:29 PST --- When final switch supports structs, writing a fizzBuzz (http://imranontech.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/ ) gets simpler and safer: import std.stdio, std.typecons; void main() { foreach (immutable i; 1 .. 101) { final switch (tuple(i % 3 == 0, i % 5 == 0)) { case tuple(false, false): writeln(num); break; case tuple(false, true): writeln("Buzz"); break; case tuple( true, false): writeln("Fizz"); break; case tuple( true, true): writeln("FizzBuzz"); break; } } } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
