[nem-en] Marcos and intelligence

Michal Moskal michal.moskal at gmail.com
Sun Oct 22 10:00:31 CEST 2006


On 10/22/06, Павел Блудов <pbludov at gmail.com> wrote:
> the compiler produces exactly the same expression tree for both methods -
> Nemerle.Compiler.Typedtree.TExpr.Call to System.Console.Write.
> The supercompiler does not place macros in the expression tree, it places
> the result of the macro here. Just like the preprocessor of an ancient
> language does ;)
> But there is no clue which can tell me that the call to System.Console.Write
> was actually call to Nemerle.IO.printf.

I think there are two possible solutions here.

One is to color each expression with a reference to a macro that
created it. This increases size of TExpr-s as well as is difficult to
maintain when restructuring trees.

The other solution would be enclose macro generated code in some kind
of TExpr.MacroMarker(macro,expr). This would be removed by some later
stage of the compiler (T2 or T3). I think this should be easy to
implement.

-- 
   Michał


More information about the devel-en mailing list