const

Darryl Bleau user at example.net
Thu Mar 27 15:26:14 PDT 2008


Walter,

First, thank you very much for this detailed explanation. I know that I
have personally wondered what all the constant-fussing was about, and
and sure that this post serves to answer questions that others probably
share with me.


> In other words, not only do we need to explain how transitivity works in
> particular in D, we have to explain what transitivity does and what it
> is good for. For such a foreign concept, this is a tall order. I'm not
> so good at being a teacher, I tend to explain how things work in D by
> saying "it works just like X in language Y except with this little
> tweak." I can't do that with transitive const. Andrei and I have spent
> many, many hours sitting at a table with smart people explaining what
> transitivity is. It is not an easy concept. Hey, I didn't get it for a
> long time, either, which is partly why the first two const regimes in D
> were wrong.

Is there anyplace that does offer up an explanation? If there isn't, is
there potentially someone that fully understands this transitive const
situation that would be willing to write something up on this? Why it's
important, how it would be used in real world, possibly with some
concrete examples (A lot of these X(T) Y(Z : R) etc posts being made are
great and all, but bringing some reality back down in there might help
to convey understanding).


> 4. Here's the biggie. Points 1..3 are insignificant in comparison. The
> future of programming will be multicore, multithreaded. Languages that
> make it easy to program them will supplant languages that don't.
> Transitive const is key to bringing D into this paradigm. The surge in
> use of Haskell and Erlang is evidence of this coming trend (the killer
> feature of those languages is they make it easy to do multiprogramming).
> C++ cannot be retrofitted to supporting multiprogramming in a manner
> that makes it accessible. D isn't there yet, but it will be, and
> transitive const will be absolutely fundamental to making it work.

Could you expand on how this would help? Is it as simple as being able
to guarantee that certain data is not going to be altered, thusly
removing any need for guard locks et al?



More information about the Digitalmars-d mailing list