digitalmars.D.learn - where is parameterNames?
- Ellery Newcomer (3/3) Aug 13 2012 pragma(msg, __traits(parameterNames, Constructors[0]));
- Jonathan M Davis (3/8) Aug 13 2012 Parameter names aren't part of a function's API. Why would you need them...
- Ellery Newcomer (3/11) Aug 13 2012 I was thinking about adding keyword argument support to pyd wrapped
- bearophile (4/6) Aug 14 2012 Maybe you have to process the JSON output?
- Jacob Carlborg (10/13) Aug 14 2012 I don't know if this works any better:
- David Nadlinger (7/10) Aug 14 2012 Nice hack, but when using this on functions you don't control, be
- Jacob Carlborg (4/9) Aug 14 2012 Of course, this was more a "just because it's possible".
- David Nadlinger (4/5) Aug 15 2012 Related:
- Philippe Sigaud (7/13) Aug 15 2012 Hmm:
- Ellery Newcomer (3/6) Aug 19 2012 That should work nicely.
pragma(msg, __traits(parameterNames, Constructors[0])); gives me tok.d(19): Error: unrecognized trait parameterNames
Aug 13 2012
On Monday, August 13, 2012 21:40:48 Ellery Newcomer wrote:pragma(msg, __traits(parameterNames, Constructors[0])); gives me tok.d(19): Error: unrecognized trait parameterNamesParameter names aren't part of a function's API. Why would you need them? - Jonathan M Davis
Aug 13 2012
On 08/13/2012 09:49 PM, Jonathan M Davis wrote:On Monday, August 13, 2012 21:40:48 Ellery Newcomer wrote:I was thinking about adding keyword argument support to pyd wrapped functions.pragma(msg, __traits(parameterNames, Constructors[0])); gives me tok.d(19): Error: unrecognized trait parameterNamesParameter names aren't part of a function's API. Why would you need them? - Jonathan M Davis
Aug 13 2012
Ellery Newcomer:I was thinking about adding keyword argument support to pyd wrapped functions.Maybe you have to process the JSON output? Bye, bearophile
Aug 14 2012
On 2012-08-14 06:40, Ellery Newcomer wrote:pragma(msg, __traits(parameterNames, Constructors[0])); gives me tok.d(19): Error: unrecognized trait parameterNamesI don't know if this works any better: https://github.com/jacob-carlborg/orange/blob/master/orange/util/Reflection.d#L29 It's a simple implementation. I also have a function which also you to call another function using named arguments: https://github.com/jacob-carlborg/orange/blob/master/orange/util/Reflection.d#L135 Neither of these two support delegate parameters. -- /Jacob Carlborg
Aug 14 2012
On Tuesday, 14 August 2012 at 16:06:33 UTC, Jacob Carlborg wrote:I don't know if this works any better: https://github.com/jacob-carlborg/orange/blob/master/orange/util/Reflection.d#L29 It's a simple implementation.Nice hack, but when using this on functions you don't control, be aware that parameter names are officially not considered part of the API (as it became clear in the named parameter-related discussions). This implies that e.g. the parameter names of Phobos functions might change at any time. David
Aug 14 2012
On 2012-08-14 20:29, David Nadlinger wrote:Nice hack, but when using this on functions you don't control, be aware that parameter names are officially not considered part of the API (as it became clear in the named parameter-related discussions). This implies that e.g. the parameter names of Phobos functions might change at any time.Of course, this was more a "just because it's possible". -- /Jacob Carlborg
Aug 14 2012
On Tuesday, 14 August 2012 at 16:06:33 UTC, Jacob Carlborg wrote:https://github.com/jacob-carlborg/orange/blob/master/orange/util/Reflection.d#L29Related: https://github.com/D-Programming-Language/phobos/blob/master/std/traits.d#L510 David
Aug 15 2012
On Wed, Aug 15, 2012 at 6:46 PM, David Nadlinger <see klickverbot.at> wrote:On Tuesday, 14 August 2012 at 16:06:33 UTC, Jacob Carlborg wrote:Hmm: static if (is(typeof(func[0]) PT == __parameters)) __parameters is a new feature in is()' treasure vault, right? Testing it, it seems to return the parameter tuple of a function. That's cool. However, that'd be cooler if it was documented somewhere. Was that in 2.060 changelog?https://github.com/jacob-carlborg/orange/blob/master/orange/util/Reflection.d#L29Related: https://github.com/D-Programming-Language/phobos/blob/master/std/traits.d#L510
Aug 15 2012
On 08/15/2012 09:46 AM, David Nadlinger wrote:Related: https://github.com/D-Programming-Language/phobos/blob/master/std/traits.d#L510 DavidThat should work nicely. Why does it not show up on dlang.org?
Aug 19 2012