const sucks

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Oct 19 14:14:02 PDT 2008


Derek Parnell wrote:
> On Sat, 18 Oct 2008 20:36:51 -0700, Walter Bright wrote:
> 
>> The problem is things like:
>>
>>    void foo(int[] a)
>>    {
>>      int[] b;
>>    }
>>
>> so a is const, and b is mutable? That's very confusing. It gives the 
>> appearance of D having a lot of wacky and arbitrary semantic rules.
> 
> I work with the Euphoria language and this has been the case since its
> begining. No one, from newbie-coder to experienced coders of a number of
> languages have EVER thought this as weird.
> 
> In Euphoria, there is NO WAY one can change a function's argument. The
> caller of a function can have complete confidence that any argument passed
> will not have its value changed by the function. However, variables local
> to the function are not immutable.
> 
> Your fears may need empirical evidence before I would take them seriously.

Well claiming that you know what everybody using Euphoria has ever 
thought sets the standard pretty low in terms of evidence.

Andrei



More information about the Digitalmars-d mailing list