www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - version with identifier and number

reply "Frank Benoit (keinfarbton)" <benoit tionex.removethispart.de> writes:
Version can be an identifier or an integer.

But there is a need for having the combination:

- If there is a change in the dmd frontend, which makes source code
incompatible, but you want to have your source compiling with the old
and new dmd version.
- If a used lib changes its interface


The dmd commandline switch can look like this:
-version="MyId=23"
or
-version=MyId,23


The version statement can look like this:

version( MyId, 23 ){
	// 23 and higher
}
else version( MyId, 15 ){
	// 15 .. 22
}
else{
	// 0 .. 14
}

See also http://www.digitalmars.com/d/version.html
Nov 13 2006
parent "John Reimer" <terminal.node gmail.com> writes:
On Mon, 13 Nov 2006 12:12:59 -0800, Frank Benoit (keinfarbton)  =

<benoit tionex.removethispart.de> wrote:

 Version can be an identifier or an integer.

 But there is a need for having the combination:

 - If there is a change in the dmd frontend, which makes source code
 incompatible, but you want to have your source compiling with the old
 and new dmd version.
 - If a used lib changes its interface


 The dmd commandline switch can look like this:
 -version=3D"MyId=3D23"
 or
 -version=3DMyId,23


 The version statement can look like this:

 version( MyId, 23 ){
 	// 23 and higher
 }
 else version( MyId, 15 ){
 	// 15 .. 22
 }
 else{
 	// 0 .. 14
 }

 See also http://www.digitalmars.com/d/version.html

Hmmm... sounds like a very good idea, especially as version 1.0 approach= es. -JJR
Nov 13 2006