December 07, 2004
Regan Heath wrote:

> IMHO they should be case insensitive, after all when are you ever going to  want "Abc" or "ABC" or "abc" to mean different things!?

Ehrm, D is a case *sensitive* language ?

Which is a good thing I think, if nothing
else to keep people from writing "Pascal"...

I'll settle for the "alternative" spelling,
just because I'm a little consistency freak.

--anders
December 08, 2004
On Tue, 07 Dec 2004 22:33:49 +0100, Anders F Björklund <afb@algonet.se> wrote:
> Regan Heath wrote:
>
>> IMHO they should be case insensitive, after all when are you ever going to  want "Abc" or "ABC" or "abc" to mean different things!?
>
> Ehrm, D is a case *sensitive* language ?

I know. That and every other reason I've heard for the current situation doesn't impress me in the slightest.

> Which is a good thing I think, if nothing
> else to keep people from writing "Pascal"...
>
> I'll settle for the "alternative" spelling,
> just because I'm a little consistency freak.

I would not mind if it were simply consistent i.e. always lowercase or always capitalised first letter, but the current situation is not consistent. IMO adding alternatives will only confuse matters.

Regan
December 08, 2004
In article <opsinzx8ol23k2f5@ally>, Regan Heath says...
>
>On Tue, 07 Dec 2004 22:33:49 +0100, Anders F Björklund <afb@algonet.se> wrote:
>> Regan Heath wrote:
>>
>>> IMHO they should be case insensitive, after all when are you ever going to  want "Abc" or "ABC" or "abc" to mean different things!?
>>
>> Ehrm, D is a case *sensitive* language ?
>
>I know. That and every other reason I've heard for the current situation doesn't impress me in the slightest.
>
>> Which is a good thing I think, if nothing
>> else to keep people from writing "Pascal"...
>>
>> I'll settle for the "alternative" spelling,
>> just because I'm a little consistency freak.
>
>I would not mind if it were simply consistent i.e. always lowercase or always capitalised first letter, but the current situation is not consistent. IMO adding alternatives will only confuse matters.
>
>Regan

I think last time this subject came up I wrote that we should use all lowercase across the board:

version(windows)
version(linux)
version(posix)
version(darwin)

We're not at 1.0 yet, but it does seem a little late to be fixing this. But the current system is woefully inconsistent as is clearly demonstrated by this thread, so I think we need to consider adopting a consistent convention that can last.

jcc7
December 08, 2004
Anders F Björklund schrieb am Dienstag, 7. Dezember 2004 21:00:
>>>I think it's a little like : Windows / Win32 ?
>>>("operating system" vs. "application interface)
>> 
>> I see what you are saying.  But I don't think "Unix" fits into this picture correctly.  "FreeBSD", "Linux", "Darwin", "AIX" -> "Posix" do fit.
> 
> No argument there. "version (Posix)" would work nice I think ?
> 
> And I wouldn't cry if "Linux" and "Darwin" were added too, in addition to the current "linux" and "darwin" versions...

The attached patch:
1) adds "Posix" for Linux platfroms
2) replaces "Unix", "linux" and "darwin" with "Posix", "Linux" and "darwin"
3) enables "Unix", "linux" and "darwin" in the deprecated mode (dmd -d)

Thomas

December 08, 2004
Thomas Kuehne wrote:

> The attached patch:
> 1) adds "Posix" for Linux platfroms
> 2) replaces "Unix", "linux" and "darwin" with "Posix", "Linux" and "Darwin"
> 3) enables "Unix", "linux" and "darwin" in the deprecated mode (dmd -d)

Sounds good!

Let's see if it catches on (i.e. what Walter thinks)

I'm pretty sure that the lowercase "linux" will remain, :(
for compatibility with some old C compiler or what it was.
At least it seemed that way, last time this was discussed -
in the context of the usage of version(Linux) in std/loader.d
(there's also a long d.D thread called "versioning other OS")

But whether it is offically deprecated or not, I like the new ones.

--anders
December 08, 2004
Thanks Thomas!

I too hope it gains support.

Later,

John

Thomas Kuehne wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Anders F Björklund schrieb am Dienstag, 7. Dezember 2004 21:00:
> 
>>>>I think it's a little like : Windows / Win32 ?
>>>>("operating system" vs. "application interface)
>>>
>>>I see what you are saying.  But I don't think "Unix" fits into this
>>>picture correctly.  "FreeBSD", "Linux", "Darwin", "AIX" -> "Posix" do
>>>fit.
>>
>>No argument there. "version (Posix)" would work nice I think ?
>>
>>And I wouldn't cry if "Linux" and "Darwin" were added too,
>>in addition to the current "linux" and "darwin" versions...
> 
> 
> The attached patch:
> 1) adds "Posix" for Linux platfroms
> 2) replaces "Unix", "linux" and "darwin" with "Posix", "Linux" and "darwin"
> 3) enables "Unix", "linux" and "darwin" in the deprecated mode (dmd -d)
> 
> Thomas
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.9.13 (GNU/Linux)
> 
> iD8DBQFBtt2O3w+/yD4P9tIRAtdsAKDMVaXNHD/qGfHHCLsi+LXIIwFk6gCfVhD4
> vdwwoUnsE/VmCI4SCt6ssms=
> =6cT2
> -----END PGP SIGNATURE-----
> 
> 
> ------------------------------------------------------------------------
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> NotDashEscaped: You need GnuPG to verify this message
> 
> # 1) adds version identifier Posix for Linux systems
> # 2) declares Unix, linux and darwin as deprecated version identifiers
> 
> diff -ur org-0.109/dmd/src/dmd/mars.c neu-0.109/dmd/src/dmd/mars.c
> --- org-0.109/dmd/src/dmd/mars.c	2004-12-01 01:18:22.000000000 +0100
> +++ neu-0.109/dmd/src/dmd/mars.c	2004-12-08 11:30:50.513512192 +0100
> @@ -192,7 +192,8 @@
>      VersionCondition::addPredefinedGlobalIdent("Win32");
> 
>  #endif
> 
>  #if linux
> 
> -    VersionCondition::addPredefinedGlobalIdent("linux");
> 
> +    VersionCondition::addPredefinedGlobalIdent("Posix");
> 
> +    VersionCondition::addPredefinedGlobalIdent("Linux");
> 
>      global.params.isLinux = 1;
> 
>  #endif /* linux */
> 
>      VersionCondition::addPredefinedGlobalIdent("X86");
> 
> diff -ur org-0.109/dmd/src/dmd/parse.c neu-0.109/dmd/src/dmd/parse.c
> --- org-0.109/dmd/src/dmd/parse.c	2004-12-03 01:19:56.000000000 +0100
> +++ neu-0.109/dmd/src/dmd/parse.c	2004-12-08 11:30:50.625495168 +0100
> @@ -584,9 +584,27 @@
>      unsigned level = 1;
> 
>      Identifier *id = NULL;
> 
>  
> 
> -    if (token.value == TOKidentifier)
> 
> -	id = token.ident;
> 
> -    else if (token.value == TOKint32v)
> 
> +    if (token.value == TOKidentifier){
> 
> +		static char* oldVersion[] = {
> 
> +			"Unix", "linux", "darwin"
> 
> +		}; 
> 
> +
> 
> +		static char* newVersion[] = {
> 
> +			"Posix", "Linux", "Darwin"
> 
> +		};
> 
> +
> 
> +		for(size_t i = 0; i < sizeof(oldVersion) / sizeof(oldVersion[0]); i++){
> 
> +			if(strcmp(oldVersion[i], token.ident->string)==0){
> 
> +				if(global.params.useDeprecated){
> 
> +					token.ident->string=newVersion[i];
> 
> +				}else{
> 
> +					error("version identifier '%s' is deprecated, use '%s'", oldVersion[i], newVersion[i]);
> 
> +				}
> 
> +				break;
> 
> +			}
> 
> +		}
> 
> +		id = token.ident;
> 
> +    }else if (token.value == TOKint32v)
> 
>  	level = (unsigned)token.uns64value;
> 
>      else
> 
>  	error("identifier or integer expected, not %s", token.toChars());
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.9.13 (GNU/Linux)
> 
> iD8DBQFBttuP3w+/yD4P9tIRAkYiAJ9avP0xiowYFU0QRook2g9MLYVvwgCdG8yM
> ZwjgCIJ4TvLoDfpjSihRgE0=
> =TM6X
> -----END PGP SIGNATURE-----
December 08, 2004
I certainly support this. The current scheme is confusing and no reason can possibly be good enough to support it.

Lars Ivar Igesund

John Reimer wrote:
> Thanks Thomas!
> 
> I too hope it gains support.
> 
> Later,
> 
> John
> 
> Thomas Kuehne wrote:
> 
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Anders F Björklund schrieb am Dienstag, 7. Dezember 2004 21:00:
>>
>>>>> I think it's a little like : Windows / Win32 ?
>>>>> ("operating system" vs. "application interface)
>>>>
>>>>
>>>> I see what you are saying.  But I don't think "Unix" fits into this
>>>> picture correctly.  "FreeBSD", "Linux", "Darwin", "AIX" -> "Posix" do
>>>> fit.
>>>
>>>
>>> No argument there. "version (Posix)" would work nice I think ?
>>>
>>> And I wouldn't cry if "Linux" and "Darwin" were added too,
>>> in addition to the current "linux" and "darwin" versions...
>>
>>
>>
>> The attached patch:
>> 1) adds "Posix" for Linux platfroms
>> 2) replaces "Unix", "linux" and "darwin" with "Posix", "Linux" and "darwin"
>> 3) enables "Unix", "linux" and "darwin" in the deprecated mode (dmd -d)
>>
>> Thomas
>>
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.9.13 (GNU/Linux)
>>
>> iD8DBQFBtt2O3w+/yD4P9tIRAtdsAKDMVaXNHD/qGfHHCLsi+LXIIwFk6gCfVhD4
>> vdwwoUnsE/VmCI4SCt6ssms=
>> =6cT2
>> -----END PGP SIGNATURE-----
>>
>>
>> ------------------------------------------------------------------------
>>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>> NotDashEscaped: You need GnuPG to verify this message
>>
>> # 1) adds version identifier Posix for Linux systems
>> # 2) declares Unix, linux and darwin as deprecated version identifiers
>>
>> diff -ur org-0.109/dmd/src/dmd/mars.c neu-0.109/dmd/src/dmd/mars.c
>> --- org-0.109/dmd/src/dmd/mars.c    2004-12-01 01:18:22.000000000 +0100
>> +++ neu-0.109/dmd/src/dmd/mars.c    2004-12-08 11:30:50.513512192 +0100
>> @@ -192,7 +192,8 @@
>>      VersionCondition::addPredefinedGlobalIdent("Win32");
>>
>>  #endif
>>
>>  #if linux
>>
>> -    VersionCondition::addPredefinedGlobalIdent("linux");
>>
>> +    VersionCondition::addPredefinedGlobalIdent("Posix");
>>
>> +    VersionCondition::addPredefinedGlobalIdent("Linux");
>>
>>      global.params.isLinux = 1;
>>
>>  #endif /* linux */
>>
>>      VersionCondition::addPredefinedGlobalIdent("X86");
>>
>> diff -ur org-0.109/dmd/src/dmd/parse.c neu-0.109/dmd/src/dmd/parse.c
>> --- org-0.109/dmd/src/dmd/parse.c    2004-12-03 01:19:56.000000000 +0100
>> +++ neu-0.109/dmd/src/dmd/parse.c    2004-12-08 11:30:50.625495168 +0100
>> @@ -584,9 +584,27 @@
>>      unsigned level = 1;
>>
>>      Identifier *id = NULL;
>>
>>  
>>
>> -    if (token.value == TOKidentifier)
>>
>> -    id = token.ident;
>>
>> -    else if (token.value == TOKint32v)
>>
>> +    if (token.value == TOKidentifier){
>>
>> +        static char* oldVersion[] = {
>>
>> +            "Unix", "linux", "darwin"
>>
>> +        };
>> +
>>
>> +        static char* newVersion[] = {
>>
>> +            "Posix", "Linux", "Darwin"
>>
>> +        };
>>
>> +
>>
>> +        for(size_t i = 0; i < sizeof(oldVersion) / sizeof(oldVersion[0]); i++){
>>
>> +            if(strcmp(oldVersion[i], token.ident->string)==0){
>>
>> +                if(global.params.useDeprecated){
>>
>> +                    token.ident->string=newVersion[i];
>>
>> +                }else{
>>
>> +                    error("version identifier '%s' is deprecated, use '%s'", oldVersion[i], newVersion[i]);
>>
>> +                }
>>
>> +                break;
>>
>> +            }
>>
>> +        }
>>
>> +        id = token.ident;
>>
>> +    }else if (token.value == TOKint32v)
>>
>>      level = (unsigned)token.uns64value;
>>
>>      else
>>
>>      error("identifier or integer expected, not %s", token.toChars());
>>
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.9.13 (GNU/Linux)
>>
>> iD8DBQFBttuP3w+/yD4P9tIRAkYiAJ9avP0xiowYFU0QRook2g9MLYVvwgCdG8yM
>> ZwjgCIJ4TvLoDfpjSihRgE0=
>> =TM6X
>> -----END PGP SIGNATURE-----
December 08, 2004
On Wed, 08 Dec 2004 11:55:07 +0100, Thomas Kuehne <thomas-dloop@kuehne.thisisspam.cn> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Anders F Björklund schrieb am Dienstag, 7. Dezember 2004 21:00:
>>>> I think it's a little like : Windows / Win32 ?
>>>> ("operating system" vs. "application interface)
>>>
>>> I see what you are saying.  But I don't think "Unix" fits into this
>>> picture correctly.  "FreeBSD", "Linux", "Darwin", "AIX" -> "Posix" do
>>> fit.
>>
>> No argument there. "version (Posix)" would work nice I think ?
>>
>> And I wouldn't cry if "Linux" and "Darwin" were added too,
>> in addition to the current "linux" and "darwin" versions...
>
> The attached patch:
> 1) adds "Posix" for Linux platfroms
> 2) replaces "Unix", "linux" and "darwin" with "Posix", "Linux" and "darwin"
> 3) enables "Unix", "linux" and "darwin" in the deprecated mode (dmd -d)

Why not "Darwin"? To be consistent.

Regan
December 08, 2004
On Wed, 8 Dec 2004 05:42:14 +0000 (UTC), J C Calvarese <jcc7@cox.net> wrote:
> In article <opsinzx8ol23k2f5@ally>, Regan Heath says...
>>
>> On Tue, 07 Dec 2004 22:33:49 +0100, Anders F Björklund <afb@algonet.se>
>> wrote:
>>> Regan Heath wrote:
>>>
>>>> IMHO they should be case insensitive, after all when are you ever going
>>>> to  want "Abc" or "ABC" or "abc" to mean different things!?
>>>
>>> Ehrm, D is a case *sensitive* language ?
>>
>> I know. That and every other reason I've heard for the current situation
>> doesn't impress me in the slightest.
>>
>>> Which is a good thing I think, if nothing
>>> else to keep people from writing "Pascal"...
>>>
>>> I'll settle for the "alternative" spelling,
>>> just because I'm a little consistency freak.
>>
>> I would not mind if it were simply consistent i.e. always lowercase or
>> always capitalised first letter, but the current situation is not
>> consistent. IMO adding alternatives will only confuse matters.
>>
>> Regan
>
> I think last time this subject came up I wrote that we should use all lowercase
> across the board:
>
> version(windows)
> version(linux)
> version(posix)
> version(darwin)
>
> We're not at 1.0 yet, but it does seem a little late to be fixing this.

It's never too late. Find and replace will handle this change easily.

> But the
> current system is woefully inconsistent as is clearly demonstrated by this
> thread, so I think we need to consider adopting a consistent convention that can
> last.

Agreed. My vote goes to any of the following:

1. all lowercase
2. capitalise first letter
3. all uppercase

in that order, I find #3 uglier than #1 and #2. I think #1 is slightly better in that it's slightly less of a pain to type.

Regan
December 08, 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message

Regan Heath schrieb am Thu, 09 Dec 2004 10:11:18 +1300:
> On Wed, 08 Dec 2004 11:55:07 +0100, Thomas Kuehne
><thomas-dloop@kuehne.thisisspam.cn> wrote:
>>
>> The attached patch:
>> 1) adds "Posix" for Linux platforms
>> 2) replaces "Unix", "linux" and "darwin" with "Posix", "Linux" and
>> "darwin"
>> 3) enables "Unix", "linux" and "darwin" in the deprecated mode (dmd -d)
>
> Why not "Darwin"? To be consistent.
>

That's a typo ...

The actual patch uses "Darwin" *g*

Thomas

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.9.13 (GNU/Linux)

iD8DBQFBt3b93w+/yD4P9tIRAol9AKC8I29l0X2uNsA0MSASxJ0ppM+eDQCgg3mV
35RrLfkxHEWQwh7fdf0VVWI=
=3t4N
-----END PGP SIGNATURE-----