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

           Summary: Add introspection for templates
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Andrei Alexandrescu <[email protected]> 2013-02-27 05:12:46 
PST ---
Currently given a template symbol it's not possible to do simple introspection
on it, such as getting arity, distinguishing alias vs. type parameters, and
figuring out variadics.

Example:

    template A(alias sym)
    {
        ...
    }
    A!((a, b) => a.name < b.name);

A is unable to tell the number of parameters of the lambda. It could if it knew
what type to instantiate it, and in order to know that it needs the actual
instantiation type. There should be enough introspection chops to compute the
number of parameters without instantiating the lambda.

There would be a fair amount of design involved because currently there's no
kind that expresses a template's parameters outside the template.

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

Reply via email to