pragmas for expressions?

Gregor Richards Richards at codu.org
Wed Oct 22 10:17:39 PDT 2008


mgen wrote:
> I have been hacking into the front end as of late and noticed that pragmas cannot be introduced as parts of expressions and instead must be used as a separated statements. My main concern here is sometimes I wish to set up a value that could be returned and used by the code at compile time; for example:
> 
> pragma(msg,"you do not have a version set up... please select unix, linux, windows, or mac by entering the name and pressing enter");
> char[] response = pragma(readln);
> 
> which could ease the use of things especially build scripts having odd errors that could be corrected at compile time instead of having an entire rerun of the script.
> 
> All in all I was wondering what people thought of using pragmas inside of expressions?

Pragmas in expressions: Could be useful, but I'd have to see a good use 
case.

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



More information about the Digitalmars-d mailing list