Fully transitive const is not necessary

Craig Black craigblack2 at cox.net
Wed Apr 2 23:10:24 PDT 2008


"Walter Bright" <newshound1 at digitalmars.com> wrote in message 
news:ft1poo$1js8$1 at digitalmars.com...
> Craig Black wrote:
>> This is due to the fact that it has a completely different design goal 
>> from C++'s const, based on a hypothetical compiler optimization benefit 
>> that no one seems to fully understand.
>
> See http://www.digitalmars.com/d/2.0/const-faq.html#const for what the 
> goals are.

Yeah I understand the concept, but I have doubts as to whether the benefits 
you speak of will materialize.  Multiprogramming is very complex.  But I 
hope it will work as you say, and I do think it's worth a try.  I'm also 
coming to the realization that D's const is not as bad as everyone is making 
it out to be.  For example, D doesn't provide mutable fields.  I thought 
this was going to be a big problem, but as Janice pointed out, there are 
trivial workarounds.  It's similar to how D doesn't provide bitfields, but 
it does provide std.bitfield, which works just as good.  So I think I'm 
coming around.

-Craig 




More information about the Digitalmars-d mailing list