this is almost a workaround for the lack of named parameters
Philippe Sigaud
philippe.sigaud at gmail.com
Sun Mar 24 01:13:57 PDT 2013
> It's now looking pretty close to the ideal D syntax:
> auto a=fun(z:3,x:4);
The last time I tried this (maybe 2 years ago, so before
std.traits.ParameterNameTuple?), I used associative arrays:
alias nfoo = named!foo; // nfoo is now a function admitting AA as arguments
auto result = nfoo(["z":"Title"], ["x":1, "y":100]);
Also, I see that at one time, you used a full string syntax:
auto result = nfoo(q{z = "Title", x = 1, y = 100}); // nfoo will parse
the input string
I rather like this one. Why did you ditch it?
More information about the Digitalmars-d
mailing list