static version proposal

Gor F. Gyolchanyan gor.f.gyolchanyan at gmail.com
Fri Sep 23 05:34:23 PDT 2011


So many times did i feel the need for this feature:

// ---------- first module ----------
module first;

static version = MY_API;

/*
 * My API implementation.
 */

// ---------- second module ----------
module second;

import first;

version(MY_API)
{
    // My API usage.
}

The behavior is exactly the same as with -version=MY_API passed to command prompt.

This doesn't look like a difficult feature to implement, and AFAIK a very
useful one (especially when binding C libraries, which define compile-time
version information).


More information about the Digitalmars-d mailing list