www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: Const sucks

reply Bruce Adams <tortoise_74 yeah.who.co.uk> writes:
Nathan Reed Wrote:

 Janice Caron wrote:
 I want to be able to *express the idea* that the value I am declaring
 shall never change. To my mind:
 
 const int NUM_DAYS_IN_WEEK = 7;
 
 successfully expresses that idea, and frankly, I whether or not
 NUM_DAYS_IN_WEEK consumes memory should not be my call. That is an
 implementation detail, and should be the compiler's problem, not mine.

Agree. Thanks, Nathan Reed

Already agreed on another thread but worth every extra vote.
Sep 11 2007
parent Charles <charles jwavro.com> writes:
Agreed!

Bruce Adams Wrote:

 Nathan Reed Wrote:
 
 Janice Caron wrote:
 I want to be able to *express the idea* that the value I am declaring
 shall never change. To my mind:
 
 const int NUM_DAYS_IN_WEEK = 7;
 
 successfully expresses that idea, and frankly, I whether or not
 NUM_DAYS_IN_WEEK consumes memory should not be my call. That is an
 implementation detail, and should be the compiler's problem, not mine.

Agree. Thanks, Nathan Reed

Already agreed on another thread but worth every extra vote.

Sep 11 2007