D const design rationale

Sean Kelly sean at f4.ca
Sat Jun 23 22:23:51 PDT 2007


Bill Baxter wrote:
> Sean Kelly wrote:
>> Derek Parnell wrote:
> 
>>> A second issue I have is that by forcing 'const' to be explicitly 
>>> coded in
>>> function parameter lists, you are reducing the ability of the 
>>> compiler to
>>> help detect bugs.
>>
>> Isn't this necessary though?  Say the function declaration is 
>> available to the compiler but the implementation is not.  The compiler 
>> needs to know what kind of data can legally be passed as parameters.
> 
> I took that to mean he wanted to make const the default.
> 
> I too am disappointed that the only rebuttal from Walter on const by 
> default has been "some C++ guys I talked to thought it was weird".

Same here.  It's an elegant concept and I'd really like to give it a 
try.  I think only experience could tell whether it's a practical solution.


Sean



More information about the Digitalmars-d mailing list