any news on const/invariant?

Walter Bright newshound1 at digitalmars.com
Wed Nov 28 21:04:26 PST 2007


Bill Baxter wrote:
> Doesn't
>    const int func();
> 
> break things in a way that might not caught by a compiler?

I can't think of a way.


>>> And the only commentary I've heard on that feature from D users has 
>>> been negative.  There could be a "silent majority" in favor of it, 
>>> but I doubt it.
>>
>> But I've seen converted code that used it.
> 
> That doesn't mean they consciously used it, or that they would mind 
> changing it if it were pointed out to them.  Heck I might even be using 
> it in OpenMesh/D.  But that's just laziness.  If someone points out to 
> me where I am using it, I will change it.  If the compiler pointed out 
> to me that I was using it, I would change it.
> 
> Don't know if I'm like everyone there.
> 
> But there is also the issue with C style function pointer declarations. 
>  Wasn't that allowed for a while then eventually gotten rid of in favor 
> of "just one way to do it"?

The C way is still supported.



More information about the Digitalmars-d mailing list