[Issue 2370] Version statement enhancement: versioned identifiers
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Oct 3 09:31:20 PDT 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2370
------- Comment #6 from brunodomedeiros+bugz at gmail.com 2008-10-03 11:31 -------
If you add a specific feature in a given version, it's best (clearer) to add a:
version = NiftyMyLibCallAvailable;
and then use:
version(NiftyMyLibCallAvailable)
{
NiftyMyLibCall();
}
instead of version numbers.
In any case, when releasing a new version:
Your approach:
* go to the 'version = MyLibVersion(20);' statement
* change it to 'version = MyLibVersion(21);'
My approach:
* go to the 'version = MyLibVersion20OrAbove;' statement
* add a 'version = MyLibVersion21OrAbove;' statement
How is my approach any more tedious, error-prone, or less automated? They are
both one line changes you have to make (mine has an extra copy&paste), and they
are both dead easy to make. My approach may end up with more code written, but
that's hardly ever more error-prone, since that code is not supposed to change
or be maintained (one doesn't usually downgrade the version number of a lib).
--
More information about the Digitalmars-d-bugs
mailing list