const question/suggestion

janderson askme at me.com
Thu Jun 21 08:43:51 PDT 2007


Craig Black wrote:
> OK, I think I'm starting to grasp the subtle differences between const, 
> final, and invariant.  It seems to me that to have three keywords is 
> unnecessary.  Perhaps const and final could be merged into one?
> 
> From my understanding, the only difference between const and final is that 
> local final fields can be initialized in a constructor, right?  Couldn't 
> that just be the default behavior of a local const field?  Then we could get 
> rid of final and have only two keywords.  Or am I missing something?  IMO, 
> two keywords is way less confusing than three.
> 
> Another question.  Since invariant data should always be invariant, does it 
> make sense to be able to cast non-invariant data to invariant?  The compiler 
> will think that it is invariant when it isn't.
> 
> -Craig 
> 
> 

I hate to be the meanie here but this newsgroup this is the sort of 
message I think belongs in digitalmars.D.

-Joel



More information about the Digitalmars-d-announce mailing list