It seems doable to have some kind of function transformer (adaptor?) for this.<br><br>from:<br><br>int foo(int a = 0, int b = 1, double c = 0.0, bool d = false) { return 1;}<br><br>alias namedParams!foo nfoo;<br><br>nfoo(&quot;d&quot;, true); // a = 0, b = 1, c = 0.0, d = true<br>
nfoo(&quot;d&quot;, true, &quot;b&quot;, 100); // a=0, b=100, c=0.0, d=true<br>nfoo(1, 2, &quot;d&quot;, true);  // a=1, b=2, c=0.0, d=true<br><br>That is, it expects some values, then string/values couples.<br>Downside: in the above example, if foo accepts a string argument in first or second position the &quot;d&quot; will be passed down as an argument...<br>
<br>or, using AA syntax:<br><br>nfoo(1, [&quot;d&quot;:true],[&quot;b&quot;:100]);<br><br>Would that be palatable? Because I think it&#39;s doable.<br><br>To obtain the arguments names:<br><br>int foo(int a, int b, double c = 0.0, bool d = true) { return 1;}<br>
<br>template Name(alias foo) if (isCallable!foo)<br>{<br>    enum string Name = S!(foo.stringof);<br>}<br><br>template S(string s) // this template is just a trick because foo.stringof directly displeases DMD<br>{<br>    enum string S = s;<br>
}<br><br>writeln(Name!foo); // &quot;int(int a, int b, double c = 0, bool d = true)&quot;<br><br>So this gives me:<br><br>- the arguments names<br>- which ones have default values<br>- what is that default value<br><br>The difficulty here is correctly parsing the ( ,,,) part, without getting desoriented by argument types that themselves use (,), like templated types.<br>
<br><br>Philippe<br>