digitalmars.D.learn - version pairs?
- Jay Norwood (4/4) Apr 10 2016 Seems like there should be an extra level to the version
- hilop (4/8) Apr 10 2016 This will never be done. The language creator has strong
- Mike Parker (2/6) Apr 10 2016 What's wrong with version(X86)?
- Jonathan M Davis via Digitalmars-d-learn (21/25) Apr 10 2016 In most cases that I've seen, you only need one level of version stateme...
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
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
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
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