any news on const/invariant?

0ffh frank at frankhirsch.youknow.what.todo.net
Tue Nov 27 03:12:51 PST 2007


Derek Parnell wrote:
> On Tue, 27 Nov 2007 07:47:45 +0100, Tomas Lindquist Olsen wrote: [...] 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.

Well, I don't quite see your problem with assert. Earlier you said:

> 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 you forget (or ignore) something elemental here, which is that
runtime not equals runtime, and that you'll use you asserts only to make
sure at "test/debug"-runtime that you (and all of your co-workers) didn't
fup it. I postulate that even with head const available, you'll still have
to test your software. Or do you go "Ah, finally it compiles! Call in the
delivery boy!"? I think the difference is not so grand as you make it.

regards, frank



More information about the Digitalmars-d mailing list