Thread overview | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
March 28, 2007 Predefined Version Identifier on Linux | ||||
---|---|---|---|---|
| ||||
Hi, I wonder why the first letter of predefined identifier "linux" is not uppercased. This looks inconsistent with other uppercased identifiers and makes users confused. |
March 28, 2007 Re: Predefined Version Identifier on Linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Shan-yung Yang | Shan-yung Yang wrote:
> I wonder why the first letter of predefined identifier "linux" is not uppercased. This looks inconsistent with other uppercased identifiers and makes users confused.
It's consistent with the macro "linux" predefined by gcc on linux.
|
March 28, 2007 Re: Predefined Version Identifier on Linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright Wrote:
> Shan-yung Yang wrote:
> > I wonder why the first letter of predefined identifier "linux" is not uppercased. This looks inconsistent with other uppercased identifiers and makes users confused.
>
>
> It's consistent with the macro "linux" predefined by gcc on linux.
But on windows almost all compilers use "WIN32" or "_WIN32" with all letters uppercased. Should D also use "WIN32" by this reason?
|
March 28, 2007 Re: Predefined Version Identifier on Linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | : It's consistent with the macro "linux" predefined by gcc on linux. Version identification should be case insensitive. What is the point to make a difference between Linux linux or Win32 WIN32 win32 Did anybody asked for this before ? |
March 28, 2007 Re: Predefined Version Identifier on Linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos Smith | Carlos Smith wrote: > : It's consistent with the macro "linux" predefined by gcc on linux. > > Version identification should be case insensitive. > > What is the point to make a difference between > > Linux > linux > > or > > Win32 > WIN32 > win32 > > Did anybody asked for this before ? Probably because everything else in the language is case-sensitive; having a single, non-obvious break would be a bit silly. Plus, we would *then* have people coming and asking "why are version identifiers case-insensitive: they should be case-sensitive". <joke> Now, the *real* solution to this problem is to rename all the identifiers to use l33t speak and alternating caps. This way, everyone is annoyed equally, and no one group has an advantage over the others. Sure everybody loses, but at least we all lose *equally*. </joke> <joke type="alternate" id="1"> Just look at it this way: you Linux people are better off since you don't need to use the shift key to type your platform identifier! Less key presses == more productive! </joke> <joke type="alternate" id="2"> The real reason Walter did this is because he's trying to discourage people from writing non-portable code. He probably figures that it he makes every single platform identifier different in some subtle, non-predictable manner, people will get sick of it and just write portable code in the first place. Coming soon: version( MACos_X )! </joke> Sorry. I haven't had the opportunity to annoy anyone today, and I just watched House. Baaaad combination... ;) -- Daniel -- int getRandomNumber() { return 4; // chosen by fair dice roll. // guaranteed to be random. } http://xkcd.com/ v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP http://hackerkey.com/ |
March 28, 2007 Re: Predefined Version Identifier on Linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Daniel Keep | Daniel Keep wrote: > The real reason Walter did this is because he's trying to discourage > people from writing non-portable code. He probably figures that it he > makes every single platform identifier different in some subtle, > non-predictable manner, people will get sick of it and just write > portable code in the first place. Fortunately the other platforms are all lowercase: - linux - freebsd - cygwin - mingw32 - darwin - solaris - skyos And you can use version( Unix ) for all of those... > Coming soon: version( MACos_X )! > </joke> > > Sorry. I haven't had the opportunity to annoy anyone today, and I just > watched House. Baaaad combination... ;) There already is a version (MacOSX) in use in dAllegro. HHOS. --anders |
March 28, 2007 Re: Predefined Version Identifier on Linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Daniel Keep | : Sorry. I haven't had the opportunity to annoy anyone today, and I just : watched House. Baaaad combination... ;) LoL ! GrEaT, dO yOu FeEl BeTtEr NoW ? iF yEs, ThAn I WiLl CoNsIdEr ThIs aS mY lItTle CoNtRiBuTiOn To BrInG jOy In ThE lIfE oF sOmEoNe ! HaVe A nIcE dAy. |
March 28, 2007 Re: Predefined Version Identifier on Linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Anders F Björklund |
> Fortunately the other platforms are all lowercase:
> - linux
> - freebsd
> - cygwin
> - mingw32
> - darwin
> - solaris
> - skyos
>
> And you can use version( Unix ) for all of those...
Ehrm, "mingw32" would be Windows (or Win32?) but anyway.
--anders
|
March 28, 2007 Re: Predefined Version Identifier on Linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos Smith | Carlos Smith Wrote: > GrEaT, dO yOu FeEl BeTtEr NoW ? > iF yEs, ThAn I WiLl CoNsIdEr ThIs aS mY lItTle > CoNtRiBuTiOn To BrInG jOy In ThE lIfE oF > sOmEoNe ! > > HaVe A nIcE dAy. Wow dude. I didn't know you were the maintainer of *that many* Linux modules. They mostly follow convention, but it always irked me reading the source, 'cause the case rules change every other identifier. x = HOLY_HELL_IM_CAPITALIZED; x += WhatDoYouThink * iDontKnow(im_just_trying_to_read,thissource); |
March 28, 2007 Re: Predefined Version Identifier on Linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Shan-yung Yang | Shan-yung Yang wrote:
> Walter Bright Wrote:
>
>> Shan-yung Yang wrote:
>>> I wonder why the first letter of predefined identifier "linux" is not uppercased. This looks inconsistent with other uppercased identifiers and makes users confused.
>>
>> It's consistent with the macro "linux" predefined by gcc on linux.
>
> But on windows almost all compilers use "WIN32" or "_WIN32" with all letters uppercased. Should D also use "WIN32" by this reason?
The corresponding one would be "_WINDOWS". But that just looks so awful :-(.
|
Copyright © 1999-2021 by the D Language Foundation