any news on const/invariant?

Derek Parnell derek at nomail.afraid.org
Mon Nov 26 23:15:45 PST 2007


On Tue, 27 Nov 2007 07:47:45 +0100, Tomas Lindquist Olsen wrote:

> Derek Parnell wrote:
>> 
>> Okay, I get it. We don't actually need const/invariant at all. Instead we
>> just sprinkle our code with asserts to catch these compile-time errors at
>> run-time. Neat.
>> 
> 
> I think this new const sounds like a reasonable compromise to get simple yet still useful const 
> semantics. People will never agree 100% on how this should work, and comments like this one 
> doesn't help anything.

I agree that the const as now proposed is simple and still useful. I'm
sorry you see my comment as unhelpful.

> Walter already said there will be no head/tail const. Just const. Why bother asking how to do 
> head const?
> 
> (Or have I completely misunderstood things?)

You have not misunderstood. 

As I'm sure Walter will be the first to agree, he is not all-knowing. I
believe that there has been times when Walter has said "X", defended "X"
vigorously against "Y", but then something happens and we get "Y"
implemented instead.

I think that Walter is saying that he (currently), after much thought and
deliberation, has decided that there is no benefit to any coder in
implementing the head const paradigm in D. Therefore those unfortunates
such as myself, that can't yet grasp why there is no benefit, may feel
obliged to continue asking for an explanation or assistance about how we
could implement head const without the compiler helping us.

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
27/11/2007 5:55:45 PM



More information about the Digitalmars-d mailing list