On 2016-05-25 11:24, Daniel N wrote:

From an end-user perspective I find it reasonable to expect that an API
which takes lambda:s works consistently for both below examples. i.e. if
we support one we should support the other.

[1] fun!(     x  => y)
[2] fun!((int x) => y)

Currently I just copy/paste the fix to ParameterIdentifierTuple
everywhere as the needed primitives already exist.

Removing the already existing primitives now is imho too late, as it
breaks code, which sometimes is OK, but this time there's no clear
solution how to rewrite the broken code.

Unfinished Library based Named-parameters proof-of-concept:
(yes, I know. It needs to be updated to handle case [2])

/vote open floodgates for introspection, capitalizing on the strengths
of D.

I don't think this is the right approach. I think the correct approach is to allow introspection of template parameters [1]. That would allow to get the parameter names without having to instantiate the template.

ParameterIdentifierTuple can hopefully be updated to take advantage of this feature when it's available in compiler without requiring to change the API of ParameterIdentifierTuple.

[1] https://github.com/dlang/dmd/pull/5201

/Jacob Carlborg

Reply via email to