Is all this Invarient **** er... stuff, premature optimisation?

Walter Bright newshound1 at digitalmars.com
Mon Apr 28 21:14:14 PDT 2008


Me Here wrote:
> Walter Bright wrote:
> 
>> Me Here wrote:
>>> Just as the answer to the occasional hit-and-run death is not 
>>> banning  cars, so fixing unintentional aliasing in threaded 
>>> applications does not  lie in forcing all character arrays to be 
>>> immutable.
>>
>> D does not force all character arrays to be immutable. You can use 
>> mutable ones by declaring them as:
>>
>>     char[]
>>
>> Reference types all come in 3 flavors: mutable, read-only-view-of 
>> (i.e. const) and invariant.
> 
> Well no, but having lhe string libraries only accept and return 
> invariant strings it amounts to much the same thing.

I agreed with Janet's proposal to create a parallel set of routines that 
worked on mutable strings.


> I'm disappointed that's the only point from my post worthy of reaction :(

It appeared to me to be based on the assumption that D forced all 
character arrays to be invariant.



More information about the Digitalmars-d mailing list