[proposal] version statements with multiple arguments.

Jesse Phillips jessekphillips+D at gmail.com
Mon Oct 22 20:31:43 PDT 2012


On Tuesday, 23 October 2012 at 03:22:08 UTC, 1100110 wrote:
> So I guess in the end I am proposing a change.
> A change that I cannot see breaking backwards compatibility 
> while also shortening code duplication.
> It also seems much more 'intuitive' to me.
>
> version(Windows) version(DigitalMars) {}
> made me think twice to make sure I knew what it was doing.
>
> What do you guys think?  If this was implemented, how could it 
> break backwards compatibility?
> Is something like this worth a change?
> Are there any drawbacks to this idea?

This "issue" comes once in a while. The suggested solution:

version(OSX)
     version = Somethingable
version(Windows)
     version = Somethingable
version(FreeBSD)
     version = Somethingable

version(Somethingable)
     dosomething();

version(Linux)
    otherthing;

Not necessarily more concise but it can add description to what 
the actual version being created.


More information about the Digitalmars-d mailing list