Unofficial wish list status.(Jul 2008)

Sean Kelly sean at invisibleduck.org
Tue Jul 22 17:40:55 PDT 2008


Walter Bright wrote:
> Sean Kelly wrote:
>> I personally feel that requiring that parameters be const is 
>> sufficient for memoizing results.  Requiring invariance assumes a 
>> programming model that I simply don't endorse.  But I'll grant that 
>> it's certainly the safer approach.
> 
> What such a an approach would rely on would be the *convention* that 
> nobody would change the referenced const data from one invocation of the 
> function to the next. This contradicts the whole premise, and is no 
> better than C++.

Oops, you're right.  I was thinking simply of the data changing while 
the function was executing.  I suppose requiring invariance of 
parameters does make sense.


Sean



More information about the Digitalmars-d mailing list