No household is perfect

Shammah Chancellor anonymous at coward.com
Wed Dec 4 20:09:05 PST 2013


On 2013-12-04 03:23:59 +0000, bearophile said:

> Joshua Niehus:
> 
>> This would make for a good blog post/wiki article.  Does one already exist?
> 
> If you have a AST macros like in Julia language, I think you can write 
> something like:
> 
> @setExpr(a ∪ (b ∩ c));
> 
> The main difference is that the compiler gives you a tree in the macro 
> to work on, instead of a string to parse and munge.
> 
> Bye,
> bearophile

Can't you define

template setExpr(string expr)
{
	PeggedStuff...

	mixin(PeggedStuff());
}

setExpr!(q{a ∪ (b ∩ c)}); ?

-Shammah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20131204/42012846/attachment.html>


More information about the Digitalmars-d mailing list