Porting D2 code to D1

Jarrett Billingsley kb3ctd2 at yahoo.com
Thu Jul 17 17:59:41 PDT 2008


"Ryan Bloomfield" <_sir_maniacREMOVE_ME at yahoo.com> wrote in message 
news:g5oct3$2vpl$1 at digitalmars.com...

> Could a language construct be created in D1 and D2 to allow for a "lazy" 
> version? As Far as I understand, the compiler would have to lexically 
> analyze the code after the version is evaluated, but string mixins already 
> have to be lexed after evaluation.  I imagine the "{" and "}" operators 
> would be ambiguous, so a new operators would have to be created to signify 
> lazy syntax.   "{{" and "}}", just for example:
>
> version(d1)
> {{
>      ...
> }}
> version(d2)
> {{
>      ...
> }}
>
> The code within the blocks would be treated something like string literals 
> at the lexical stage, and kept as static data until the version statement 
> is evaluated, then code would be inserted much like string mixins already 
> do, but without the need to stringify the code.

To be honest, I kind of wish this were the case with version statements all 
the time. 





More information about the Digitalmars-d mailing list