Short list with things to finish for D2

Walter Bright newshound1 at digitalmars.com
Thu Nov 19 13:31:26 PST 2009


grauzone wrote:
> Like this:
> 
> void main(string[] commandline) {
>     struct Args {
>         string param1 = "can even have default arguments";
>         int param2;
>     }
>     Args args = getopt!(Args)(commandline);
>     writefln("param1 = %s", args.param1);
> }
> 
> No pointers. Instead of returning it, struct could be passed by ref, too.

One nice thing about your proposal is the encapsulating of all the 
parameters into one struct, instead of them being random variables.

The downside is it spreads out the call to getopt.



More information about the Digitalmars-d mailing list