feature request: __ARGS__ for logging (cf __FILE__, __LINE__, __FUNC___)
Timon Gehr
timon.gehr at gmx.ch
Mon Feb 4 16:29:52 PST 2013
On 02/04/2013 01:41 PM, Jacob Carlborg wrote:
> On 2013-02-01 18:53, bearophile wrote:
>
>> Maybe Jacob Carlborg is able to show what kind of syntax for pattern
>> matching the macros are able to create (no need to actually implement it
>> now).
>
> How would a pattern matching feature look like and behave?. I can see if
> that would be possible to implement using the AST macros I'm thinking
> about.
>
Well, ideally something like
ast.match{
2*(?a) => a+a,
(?a)+2 => 2+a,
(?e) => e,
}
The following would be feasible today, hacking around the usual hygiene
issues:
mixin(match!("ast",q{
2*(?a) => a+a,
(?a)+2 => 2+a,
(?e) => e,
});
More information about the Digitalmars-d
mailing list