feature request: __ARGS__ for logging (cf __FILE__, __LINE__, __FUNC___)
Timon Gehr
timon.gehr at gmx.ch
Tue Feb 5 03:12:21 PST 2013
On 02/05/2013 08:26 AM, Jacob Carlborg wrote:
> On 2013-02-05 01:29, Timon Gehr wrote:
>
>> Well, ideally something like
>>
>> ast.match{
>> 2*(?a) => a+a,
>> (?a)+2 => 2+a,
>> (?e) => e,
>> }
>
> Could you please elaborate how that would be, what the semantics would
> be. It doesn't look like any pattern matching I've seen in any other
> languages.
>
> For example, which value does it match on?
>
Eg:
if ast == <[2*x]>, then the result will be <[x+x]>
if ast == <[y+2]>, then the result will be <[2+y]>
More information about the Digitalmars-d
mailing list