www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Why is the "linux" version identifier all lowercase?

reply "Lars T. Kyllingstad" <public kyllingen.NOSPAMnet> writes:
http://d-programming-language.org/version.html#PredefinedVersions

Why is the "linux" version identifier all lowercase?  It really should be 
"Linux" (see e.g. www.kernel.org).

-Lars
Jul 30 2011
next sibling parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Saturday 30 July 2011 09:05:04 Lars T. Kyllingstad wrote:
 http://d-programming-language.org/version.html#PredefinedVersions
 
 Why is the "linux" version identifier all lowercase?  It really should be
 "Linux" (see e.g. www.kernel.org).
Yeah. I keep screwing up and using version(Linux). To match the others, it really should be version(linux), but so much code would break at this point if changed it that we can't just change it. We could add version(Linux), and since it's a standard version defined by the compiler, I guess that the compiler could deprecate it. Regardless, the fact that it's all lowercase when all of the others (except for unittest, none, and all) begin with an uppercase letter definitely causes bugs (for me at least). - Jonathan M Davis
Jul 30 2011
prev sibling next sibling parent Michel Fortin <michel.fortin michelf.com> writes:
On 2011-07-30 09:05:04 +0000, "Lars T. Kyllingstad" 
<public kyllingen.NOSPAMnet> said:

 http://d-programming-language.org/version.html#PredefinedVersions
 
 Why is the "linux" version identifier all lowercase?  It really should be
 "Linux" (see e.g. www.kernel.org).
Because Walter saw some code using "#ifdef linux" and thought it'd be helpful to use the same lowercase identifier in D to ease migration… or at least that's what I remember from last time this question was asked on the newsgroup. Personally I don't think it makes much sense. -- Michel Fortin michel.fortin michelf.com http://michelf.com/
Jul 30 2011
prev sibling next sibling parent reply "Nick Sabalausky" <a a.a> writes:
"Lars T. Kyllingstad" <public kyllingen.NOSPAMnet> wrote in message 
news:j10hg0$2c11$3 digitalmars.com...
 http://d-programming-language.org/version.html#PredefinedVersions

 Why is the "linux" version identifier all lowercase?
Because it's from the time when D/Phobos policy was to expect users know where an identifier was borrowed from in order to know how to spell/capitalize it, instead of being internally consistent. Seriously. I remember NG discussions a while back about why the "linux" identifier was all-lower, and that's pretty much all it amounted to, much like the pre-2.054 std.string. Well, a combination of that and the language's irritating inability to distringuish between an "off" version and a mistyped version (although this particular argument hinged on the assumption that porting C to D is a more important use of D than writing new D code). Ok, so I'm biased on the matter ;)
Jul 30 2011
parent Jesse Phillips <jessekphillips+D gmail.com> writes:
Nick Sabalausky Wrote:

 "Lars T. Kyllingstad" <public kyllingen.NOSPAMnet> wrote in message 
 news:j10hg0$2c11$3 digitalmars.com...
 http://d-programming-language.org/version.html#PredefinedVersions

 Why is the "linux" version identifier all lowercase?
Because it's from the time when D/Phobos policy was to expect users know where an identifier was borrowed from in order to know how to spell/capitalize it, instead of being internally consistent. Seriously. I remember NG discussions a while back about why the "linux" identifier was all-lower, and that's pretty much all it amounted to, much like the pre-2.054 std.string. Well, a combination of that and the language's irritating inability to distringuish between an "off" version and a mistyped version (although this particular argument hinged on the assumption that porting C to D is a more important use of D than writing new D code). Ok, so I'm biased on the matter ;)
It should probably just work for both lower and upper case. I doubt anyone would define their own identifier based on a case difference.
Jul 30 2011
prev sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 7/30/2011 2:05 AM, Lars T. Kyllingstad wrote:
 http://d-programming-language.org/version.html#PredefinedVersions

 Why is the "linux" version identifier all lowercase?
Because gcc's predefined macro is "linux".
Jul 30 2011
parent reply "Nick Sabalausky" <a a.a> writes:
"Walter Bright" <newshound2 digitalmars.com> wrote in message 
news:j11hfi$10tv$1 digitalmars.com...
 On 7/30/2011 2:05 AM, Lars T. Kyllingstad wrote:
 http://d-programming-language.org/version.html#PredefinedVersions

 Why is the "linux" version identifier all lowercase?
Because gcc's predefined macro is "linux".
If gcc defined a macro to jump off a bridge... ;)
Jul 30 2011
parent Brad Roberts <braddr puremagic.com> writes:
On Saturday, July 30, 2011 1:29:13 PM, Nick Sabalausky wrote:
 "Walter Bright" <newshound2 digitalmars.com> wrote in message 
 news:j11hfi$10tv$1 digitalmars.com...
 On 7/30/2011 2:05 AM, Lars T. Kyllingstad wrote:
 http://d-programming-language.org/version.html#PredefinedVersions

 Why is the "linux" version identifier all lowercase?
Because gcc's predefined macro is "linux".
If gcc defined a macro to jump off a bridge... ;)
Keep in mind that linux was first after windows and they were both all there was for a long long time. By the time the next OS support rolled around they were quite thoroughly baked in. Not impossible to change, but not sure worth changing either. It wouldn't be hard to argue that both linux and Linux should be defined, but.. still.
Jul 30 2011