version(D_Version2)

JMNorris nospam at nospam.com
Wed Mar 12 12:33:07 PDT 2008


Gregor Richards <Richards at codu.org> wrote in
news:47D8017C.6000003 at codu.org: 

> Alexander Panek wrote:
>> Preprocessing, probably?
> 
> Yeah, this is the "simple" way of using the C preprocessor with any 
> language.
> 
>   - Gregor Richards

Maybe someone should write a preprocessor for D, as horrifying as the 
thought may be to some.  It should:

1.  Be usable only for conditional compilation.  No constants allowed 
outside preprocessing directives and no pseudo-function macros at all.

2.  (Perhaps) work on *.dpp files and generate *.d files.

D's conditional compilation works fine *except* across versions with 
varying syntaxes (such as D1 and D2).  If D becomes popular enough to 
support multiple competing commercial compilers, then compiler-specific 
syntax extensions, syntax bugs, and other syntax hiccups will exacerbate 
the problem.

We can keep within 98% of the spirit of Walter's (and mine, for that 
matter) anti-preprocessing bias by keeping defines and D code absolutely 
segregated.

-- 
JMNorris



















More information about the Digitalmars-d mailing list