June 30, 2006
"John Reimer" <terminal.node@gmail.com> wrote in message news:e841ch$169g$1@digitaldaemon.com...
> Deewiant wrote:
>> Deewiant wrote:
>>> Sean Kelly wrote:
>>>> I've become convinced that the "default everything to const" method seems ideal, but this seems like something that should really be done before 1.0 if it's going to happen?
>>>>
>>>> Sean
>>> I agree. Walter posted somewhere in comp.lang.c++.moderated (I think it
>>> was there) that he thinks he should have made D like this from the
>>> start, but that it's too late now. With that, I disagree. We're not at
>>> 1.0 yet: it's not
>>>  too late to break even every single line of D code out there.
>>
>> I found the post in question, BTW. Here's the Google Groups link:
>>
>> http://groups.google.com/group/comp.lang.c++.moderated/tree/browse_frm/thread/d6695737a74e1853/18dc841928a6eee3?rnum=131&_done=%2Fgroup%2Fcomp.lang.c%2B%2B.moderated%2Fbrowse_frm%2Fthread%2Fd6695737a74e1853%2F840b0deea2987ee5%3Flnk%3Dst%26rnum%3D1%26#doc_3ff8dedacef55e17
>>
>> In summary:
>>
>> Andrei Alexandrescu says "Why, then, didn't D make const the default? C++
>> had a
>> good reason - C compatibility."
>>
>> Walter responds: "I should have. Too much water under the bridge for that now."
>>
>> In the same post Walter also acknowledges that "There has been some talk
>> in the
>> D newsgroups of doing that, but it has the potential to be extremely
>> disruptive."
>
>
> Absolutely. we definitely need it.  Walter, I hope you will reconsider. Many of us are more than willing to accept any of those potential disruptions.  Success often comes only with risk. :)
>
> You've got this far with such an incredible language, why not take it all the way?
>
I agree. D is still in the "experimental" or "beta" phase, that is to say you shouldn't be surprised if a change breaks your code; I'm sure most if not all of us here know that, and if you don't by this time, well...
> -JJR


June 30, 2006
"Deewiant" <deewiant.doesnotlike.spam@gmail.com> wrote in message news:e83rmr$vi5$1@digitaldaemon.com...
> Sean Kelly wrote:
>> I've become convinced that the "default everything to const" method seems
>> ideal, but this seems like something that should really be done before
>> 1.0 if
>> it's going to happen?
>>
>>
>> Sean
>
> I agree. Walter posted somewhere in comp.lang.c++.moderated (I think it
> was
> there) that he thinks he should have made D like this from the start, but
> that
> it's too late now. With that, I disagree. We're not at 1.0 yet: it's not
> too
> late to break even every single line of D code out there.

I too agree.  Making const the default and adding a mutable keyword would be wonderful.  This would more than address what seems to be one of the primary (and I think quite justified) criticisms of D by the C++ community.

This might also assist a future compiler in determining what operations could be done in parallel.

I assumed that the version numbering scheme (i.e. not yet at 1.0) was an indication that the language was still in development and might change in fairly fundamental ways.

Tony
Melbourne, Australia




June 30, 2006
Tony wrote:
> 
> 
> I too agree.  Making const the default and adding a mutable keyword would be wonderful.  This would more than address what seems to be one of the primary (and I think quite justified) criticisms of D by the C++ community.
> 
[...]

This would only apply to reference types I assume. So, when giving away a reference, would one have to grant mutability privilege any time the recipient doesn't ensure non-mutation?

If this is the case, I would advocate the use of an operator for this, something with a syntax like the address of (&) operator, maybe the "@".



void func(mute char[] arg)
{
	foreach(inout a;arg) a='\0';
}

...
char[] foo;

func(@foo);	// valid
func(foo);	// error: argument 1 of "func" is mutable
...
June 30, 2006
John Reimer wrote:
> Deewiant wrote:
>> Deewiant wrote:
>>> Sean Kelly wrote:
>>>> I've become convinced that the "default everything to const" method seems ideal, but this seems like something that should really be done before 1.0 if it's going to happen?
>>>>
>>>> Sean
>>> I agree. Walter posted somewhere in comp.lang.c++.moderated (I think it was there) that he thinks he should have made D like this from the start, but that it's too late now. With that, I disagree. We're not at 1.0 yet: it's not
>>>  too late to break even every single line of D code out there.
>>
>> I found the post in question, BTW. Here's the Google Groups link:
>>
>> http://groups.google.com/group/comp.lang.c++.moderated/tree/browse_frm/thread/d6695737a74e1853/18dc841928a6eee3?rnum=131&_done=%2Fgroup%2Fcomp.lang.c%2B%2B.moderated%2Fbrowse_frm%2Fthread%2Fd6695737a74e1853%2F840b0deea2987ee5%3Flnk%3Dst%26rnum%3D1%26#doc_3ff8dedacef55e17 
>>
>>
>> In summary:
>>
>> Andrei Alexandrescu says "Why, then, didn't D make const the default? C++ had a
>> good reason - C compatibility."
>>
>> Walter responds: "I should have. Too much water under the bridge for that now."
>>
>> In the same post Walter also acknowledges that "There has been some talk in the
>> D newsgroups of doing that, but it has the potential to be extremely disruptive."
> 
> 
> Absolutely. we definitely need it.  Walter, I hope you will reconsider.  Many of us are more than willing to accept any of those potential disruptions.  Success often comes only with risk. :)
> 
> You've got this far with such an incredible language, why not take it all the way?
> 
> -JJR

If it makes D better then add it. This goes for any feature. Of course discuss disrupting features on the NG first.
June 30, 2006
On Sat, 01 Jul 2006 05:47:51 +1000, Deewiant <deewiant.doesnotlike.spam@gmail.com> wrote:

> Deewiant wrote:

>
> I found the post in question, BTW. Here's the Google Groups link:
> In summary:
>
> Andrei Alexandrescu says "Why, then, didn't D make const the default? C++ had a
> good reason - C compatibility."
>
> Walter responds: "I should have. Too much water under the bridge for that now."
>
> In the same post Walter also acknowledges that "There has been some talk in the
> D newsgroups of doing that, but it has the potential to be extremely disruptive."

This would be a welcomed disruption as it makes D a much better product. I have no problems about retrofitting this sort of change in all my D code.

-- 
Derek Parnell
Melbourne, Australia
July 01, 2006
Yes,before 1.0, any change is not too late, always.

"Deewiant" <deewiant.doesnotlike.spam@gmail.com> ??????:e83rmr$vi5$1@digitaldaemon.com...
> Sean Kelly wrote:
>> I've become convinced that the "default everything to const" method seems
>> ideal, but this seems like something that should really be done before
>> 1.0 if
>> it's going to happen?
>>
>>
>> Sean
>
> I agree. Walter posted somewhere in comp.lang.c++.moderated (I think it
> was
> there) that he thinks he should have made D like this from the start, but
> that
> it's too late now. With that, I disagree. We're not at 1.0 yet: it's not
> too
> late to break even every single line of D code out there.


July 01, 2006
Well, I hope D gets const support somewhere in the near future, because it is also needed to be able to pass parameters to threads efficiently (i.e. without duplicating everything). There needs to be a way to specify that a certain object is immutable when you pass it to a thread to avoid unnecessary locking.

The lack of this feature is not much of a problem for small projects or when you're only dealing with your own code, but once D takes off (as I believe everybody here hopes it will) and we start using a lot of different D libraries it will become an essential feature.


Deewiant wrote:

> Deewiant wrote:
>> Sean Kelly wrote:
>>> I've become convinced that the "default everything to const" method seems ideal, but this seems like something that should really be done before 1.0 if it's going to happen?
>>> 
>>> Sean
>> 
>> I agree. Walter posted somewhere in comp.lang.c++.moderated (I think it
>> was there) that he thinks he should have made D like this from the start,
>> but that it's too late now. With that, I disagree. We're not at 1.0 yet:
>> it's not
>>  too late to break even every single line of D code out there.
> 
> I found the post in question, BTW. Here's the Google Groups link:
> 
>
http://groups.google.com/group/comp.lang.c++.moderated/tree/browse_frm/thread/d6695737a74e1853/18dc841928a6eee3?rnum=131&_done=%2Fgroup%2Fcomp.lang.c%2B%2B.moderated%2Fbrowse_frm%2Fthread%2Fd6695737a74e1853%2F840b0deea2987ee5%3Flnk%3Dst%26rnum%3D1%26#doc_3ff8dedacef55e17
> 
> In summary:
> 
> Andrei Alexandrescu says "Why, then, didn't D make const the default? C++ had a good reason - C compatibility."
> 
> Walter responds: "I should have. Too much water under the bridge for that now."
> 
> In the same post Walter also acknowledges that "There has been some talk in the D newsgroups of doing that, but it has the potential to be extremely disruptive."

July 01, 2006
Deewiant wrote:
> Sean Kelly wrote:
>> I've become convinced that the "default everything to const" method seems ideal, but this seems like something that should really be done before 1.0 if
>> it's going to happen?
>>
>> Sean
> 
> I agree. Walter posted somewhere in comp.lang.c++.moderated (I think it was
> there) that he thinks he should have made D like this from the start, but that
> it's too late now. With that, I disagree. We're not at 1.0 yet: it's not too
> late to break even every single line of D code out there.

I thought I've seen in this newsgroup a while back that Walter would make changes to the language that would break previous versions, because he didn't want it to end up like c++ (ugly patches instead of fixing things correctly and breaking compatibility)? To me that is a big plus in a language, that the author is willing to break things for the good of the language. And D hasn't even hit version 1.0 yet, so I don't see a problem at all.

Also I did sort of agree with snk_kid on one point... I don't understand why D uses "~" for adding words together instead of "+". It seems like all the other languages I use all use + for adding words. Adding makes sense for words...

I added on to what he said.
I added some words to his sentence.
If you add these two phrases together...

Is there any benefit to having a separate symbol for adding (ok, concatenating)? If not feel free to break the language here too.

Lucas
July 01, 2006
Lucas Goss wrote:
> Also I did sort of agree with snk_kid on one point... I don't understand why D uses "~" for adding words together instead of "+". It seems like all the other languages I use all use + for adding words. Adding makes sense for words...
> 
> I added on to what he said.
> I added some words to his sentence.
> If you add these two phrases together...
> 
> Is there any benefit to having a separate symbol for adding (ok, concatenating)? If not feel free to break the language here too.

Concatenation is quite different from addition:

int[3] a = [1,2,3];
int[3] b = [4,5,6];

int[] c = a + b;	// c[] = [5,7,9]
int[] d = a ~ b;	// d[] = [1,2,3,4,5,6]

Two distinct operators are necessary.
July 01, 2006
Walter Bright wrote:
> Lucas Goss wrote:
> 
>> Also I did sort of agree with snk_kid on one point... I don't understand why D uses "~" for adding words together instead of "+". It seems like all the other languages I use all use + for adding words. Adding makes sense for words...
>>
>> I added on to what he said.
>> I added some words to his sentence.
>> If you add these two phrases together...
>>
>> Is there any benefit to having a separate symbol for adding (ok, concatenating)? If not feel free to break the language here too.
> 
> 
> Concatenation is quite different from addition:
> 
> int[3] a = [1,2,3];
> int[3] b = [4,5,6];
> 
> int[] c = a + b;    // c[] = [5,7,9]
> int[] d = a ~ b;    // d[] = [1,2,3,4,5,6]
> 
> Two distinct operators are necessary.

Amen.  Disambiguation is a Good Thing(tm).

Except for "Array operations not implemented" as yet.  Any idea when this much-coveted, much-anticipated feature will come to life?  I don't mean to push, but I've dreamt of array-ops nearly since I first got involved with D back in 2003.

-- Chris Nicholson-Sauls