pragmas for expressions?

BCS ao at pathlink.com
Thu Oct 23 10:59:45 PDT 2008


>Reply to mgen,
>
>>> The use case you provided: Disgusting, offensive, makes me want to
>>> find you and break your fingers. Compilation is a NON-INTERACTIVE
>>> PROCESS. Repeat that to yourself.
>>> 
>>> - Gregor Richards
>>> 
>> Compilation may be non-interactive in your mind but I see it as being
>> similair to build scripting when you do CTFE or some kind of
>> computation. Having the option to do interesting things such as check
>> and correct things instead of completely rebuilding does not seem like
>> something that should just be thrown away because of your ideals that
>> compilation is done without any interaction. Other uses could be a
>> pragma for JiT eval of complex functions to return the structures of a
>> parser without resulting to struct hacks which are a horrible idea. I
>> see this as a logical step to integrate tools into compilation instead
>> of having 2 separated programs.
>> 

I'm not saying your wrong (or right) but there is a HUGE amount of tradition 
you want to go against. 

A much more approachable idea would be to have the compiler spit out sed 
commands that would fix compile errors. 

Right now it would be possible to have code print out messages about how 
to set features.

> pragma(is(typeof(some_const_flag)), "some_const_flag must be set");

switch to static if and static assert and you might be able to get more than 
one at a time.





More information about the Digitalmars-d mailing list