www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - version pairs?

reply Jay Norwood <jayn prismnet.com> writes:
Seems like there should be an extra level to the version 
statement, something like version(arch,x86).

I must be missing something about the intended use of the version 
statement.
Apr 10 2016
next sibling parent hilop <hilop hilop.online.net> writes:
On Sunday, 10 April 2016 at 13:58:17 UTC, Jay Norwood wrote:
 Seems like there should be an extra level to the version 
 statement, something like version(arch,x86).

 I must be missing something about the intended use of the 
 version statement.
This will never be done. The language creator has strong arguments against that. If you search a bit on the forum you'll find the topics where the rationale is given.
Apr 10 2016
prev sibling next sibling parent Mike Parker <aldacron gmail.com> writes:
On Sunday, 10 April 2016 at 13:58:17 UTC, Jay Norwood wrote:
 Seems like there should be an extra level to the version 
 statement, something like version(arch,x86).

 I must be missing something about the intended use of the 
 version statement.
What's wrong with version(X86)?
Apr 10 2016
prev sibling parent Jonathan M Davis via Digitalmars-d-learn writes:
On Sunday, April 10, 2016 13:58:17 Jay Norwood via Digitalmars-d-learn wrote:
 Seems like there should be an extra level to the version
 statement, something like version(arch,x86).

 I must be missing something about the intended use of the version
 statement.
In most cases that I've seen, you only need one level of version statement - usually a version for the OS is all that's needed. The need for specifying the architecture is _very_ rare from what I've seen. But if you need more levels, then just nest version statements. e.g. version(linux) { version(X86) { } else version(X86_64) { } } There some places in druntime that nest like that (I think primarily to separate the various C runtimes on systems that don't have only one), but as it is, version statements of any kind aren't needed all that frequently in Phobos - and when they are, it's almost inevitably because they're wrapping C functionality. Pure D stuff tends to be system-agnostic and therefore not version-statement heavy. - Jonathan M Davis
Apr 10 2016