Signed word lengths and indexes

Walter Bright newshound1 at digitalmars.com
Wed Jun 16 13:42:25 PDT 2010


Jeff Nowakowski wrote:
> On 06/16/2010 12:33 PM, Walter Bright wrote:
>> Jeff Nowakowski wrote:
>>> On 06/15/2010 05:43 PM, Walter Bright wrote:
>>>>
>>>> One example of this is transitive immutability. Nobody asked for it.
>>>
>>> I find this hard to believe. I seem to recall that you were personally
>>> against const for a very long time. Did none of the people advocating
>>> for const suggest a deep const? Should I dig through the archives?
>>
>>
>> Andrei explained transitivity to me and convinced me of its utility.
> 
> Ok, but lots of people have been talking about const correctness for 
> years (including yourself), stemming from the known C++ problems, and I 
> don't see how "transitive immutability" (a deep const) is a new idea 
> that nobody asked for. The only thing new here is that you guys came up 
> with an implementation for D, and lots of people were glad to have it, 
> even if many were also against it.

I've talked with C++ experts for years about const. Not one of them ever 
mentioned transitivity, let alone asked for it or thought it was a desirable 
property.

After we designed transitive const for D, I presented it to several C++ experts. 
My first job was to explain what transitive meant - none of them were familiar 
with the idea. Next, it took a lot of convincing of them that this was a good 
idea. They all insisted that a const pointer to mutable data was terribly important.

While it is true that C++ people have talked about const-correctness since const 
was introduced to C++, it does not at all imply any concept or understanding of 
transitivity. Transitivity is an orthogonal idea.

The people who do understand transitive const and need no convincing are the 
functional programming crowd. What's interesting are the languages which claim 
to offer FP features, as that's the latest bandwagon, but totally miss 
transitive const.


More information about the Digitalmars-d mailing list