Compile time function execution...

Andrei Alexandrescu (See Website For Email) SeeWebsiteForEmail at erdani.org
Thu Feb 15 21:42:17 PST 2007


Derek Parnell wrote:
> On Thu, 15 Feb 2007 20:45:04 -0800, Andrei Alexandrescu (See Website For
> Email) wrote:
> 
> 
>> There's been also much discussion about the applications of code 
>> generation, and you can be sure they will be simplified by one order of 
>> magnitude by dual functions.
> 
> So this would mean that I could code ...
> 
>     mixin(
>           Conv("moveto 34,56 "
>                "drawto +100,-50 "
>                "drawto +0,+100 "
>                "pencolor red "
>                "drawto -100,-50 "
>               );
>           );
> 
> And expect that the Conv function will, at compile time, create the
> equivalent D code to implement the 2D drawn item for the target platform,
> and have the mixin insert it into the program being compiled. 

I'm thinking of the much more boring and much crappier job of generating 
proxy and stub code for RPC and IPC.

Andrei



More information about the Digitalmars-d mailing list