[Issue 8106] func.stringof with default args

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 14 01:24:51 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8106



--- Comment #11 from Manu <turkeyman at gmail.com> 2012-06-14 01:26:44 PDT ---
(In reply to comment #7)
> Suppose I made this work:
> -------------------------
> template ParameterTypeTuple(alias foo)
>
> I.e. the default argument is propagated to the tuple. Will that work for you?

That would be amazing, though the argument names are equally important too.
I'm pretty sure someone already had a pull request somewhere to add a __traits
for the arg names.


(In reply to comment #9)
> Or better:
> 
> PT[1] getDefault(PT[1..2] a) { return a[0]; }
> 
> pragma(msg, typeof(bar));
> pragma(msg, PT[1]);
> 
> PT[1] boo(PT[1..2] a) { return a[0]; }

It's not clear to me what those pragma's would produce. Just to reiterate,
type, name and default args are all important details about the parameter list.
I can't do without all 3.

If I'm generating functions to wrap other functions, the new function has to
have matching parameter names. If I use nonsense names, then auto-complete
pop-ups will just show nonsense to the user, and the user wouldn't know what
you're supposed to pass to the function.


(In reply to comment #10)
> I think that's a better solution, so I'm marking this as "won't fix".

I agree, although perhaps you shouldn't mark this as won't-fix, since I think
it's still somewhat of a bug. Just drop the priority?
func.stringof ideally shouldn't produce a syntactically incorrect string
regardless. Fortunately, with your proposed changes, I won't depend on it.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list