Get the name of a function and the parameters?

Daniel Keep daniel.keep.lists at gmail.com
Tue Apr 28 19:23:28 PDT 2009



Jarrett Billingsley wrote:
> On Tue, Apr 28, 2009 at 3:07 PM, grauzone <none at example.net> wrote:
>> I'd like to pass several functions at once. Is there a way to make this
>> variadic? The obvious approach (writing "NameOfFunc(alias f...)") fails with
>> a syntax error.
> 
> Sure, you'd just make it NameOfFunc(f...) and then recursively
> instantiate, converting one item at a time to its name until f.length
> == 0.
> 
> Alternatively, you can write a compile-time map and use NameOfFunc as
> the mapping predicate.

That requires f to be a type, which loses you the actual names.  And you
cannot (last time I checked) have aliases in a tuple.

  -- Daniel


More information about the Digitalmars-d-learn mailing list