Why version() ?

Jason House jason.james.house at gmail.com
Tue Feb 10 16:28:05 PST 2009


Walter Bright Wrote:

   
> 5. Why can't one 'version out' syntax that is not recognized by the 
> compiler?
> 
> The problem is that supporting this requires semantic analysis in order 
> to successfully lex and parse the source code. Breaking this will make 
> the lexing and parsing an order of magnitude harder for third party 
> tools to do. If you need to 'comment out' a section of syntactically 
> invalid code, use the /+ ... +/ nesting comment.

Would you be willing to introduce an alternative to /+ +/ which would be treated differently by the D1 and D2 compilers? Here are some examples with no attempt at creativity:
beginD1 endD1
D1 D1 (works like string delimiters)
/D2 D2/



More information about the Digitalmars-d mailing list