www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: A safer switch?

Andrei Alexandrescu Wrote:

 grauzone wrote:
 If you still don't like it, you can do some ugly mixin() and CTFE stuff. 
 Nobody will mind because that's modern D style.

import std.getopt; void main(string[] args) { getopt(args, "s", { writefln("handle argument -s"); }, "-m", { writefln("handle argument -m"); }); ... }

What's even better, modern D style allows you to work around some misdesigned/legacy language features.
Oct 13 2009