so what exactly is const supposed to mean?

Bruno Medeiros brunodomedeirosATgmail at SPAM.com
Tue Jul 4 14:38:31 PDT 2006


David Medlock wrote:
> kris wrote:
>>
>> Yes, it does sounds very familiar -- to take full advantage of 
>> specific hardware you may need to step away from the 'norm'. Whatever 
>> that 'norm' may be. No surprise then, that it pays to keep an open mind?
>>
>> You won't hear any argument from me regarding the typical 
>> multithreading "paradigm" ... and there are most certainly more 
>> effective methods in one manner or another ... there have been for 30 
>> years ... *shrug*
>>
>> If you intend to go on a crusade, to change the face of multithreading 
>> as we currently know and "love" it, I'll sign right up :D
>>
>> But, again, the state of immutability is *not* married to 
>> multithreading -- it just happens to be particularly useful there too :p
>>
>>
>>
> Crusade? LoL.
> I can barely work on my own projects with my daughters(1 and 3 yrs).
> 
> My point was simply that const isn't the 'pot of gold' its made out to 
> be(at least in the form espoused thus far).
> 
> 1. Tiny multithreaded advantages.
> 2. Limited optimization benefits.
> 3. Some memory optimizations for structs(call by reference).
> 
> Changing the whole language for the above just does seem like good 
> investment vs return.
> 
> Cheers
> -David

I'm assuming you meant "just doesn't seem like" up there.

The form exposed so far isn't all, const isn't just for multithreading 
apps: An immutability mechanism is great for ownership management, 
better than CoW because, like Kris said, the program becomes more 
expressive and there is more that the compiler can check and enforce 
(and it prevents redundant duping/cloning).


-- 
Bruno Medeiros - CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d-learn mailing list