Improving version(...)

Steven Schveighoffer schveiguy at yahoo.com
Mon Oct 18 10:11:02 PDT 2010


On Mon, 18 Oct 2010 12:15:47 -0400, F. Almeida  
<francisco.m.almeida at gmail.com> wrote:

> The version() { ... } blocks would greatly improve from support of
> boolean operators, which would make code much more readable.
>
> Let us assume, for example, that I have several version identifiers
> (VERSION1, VERSION2, VERSION3, VERSION4, etc.) and that a block of
> code may be compiled in the cases of VERSION1 or VERSION3. It would
> prove the simplest if one could simply use boolean operators to
> express combinations of valid versions and thus be able to do
>
>
> version(VERSION1 || VERSION3)
> {
>  // ...
> }

This has been discussed heavily in the past.  Walter doesn't want to do  
it, and this is one of those "Walter knows best" deals, don't bother  
trying.

-Steve


More information about the Digitalmars-d mailing list