string literals

Saaa empty at needmail.com
Fri Jan 25 17:07:11 PST 2008


> What's the .access property of arrays in the language you talk about?

It was a suggestion :)

>
> If you want to try the D language, you may want to use the 1.x series 
> instead of the 2.x that is alpha and has immutable strings.

Didn't they both have immutable strings?
I'm more in search of a way to make char[] not immutable anymore, for most 
things I do its only a hassle.

>
> Immutable things (like strings) are useful as AA keys too. In D 1.x (and 
> Ruvy too, maybe) you can use a string as key, but if you later change that 
> string its hash function isn't automatically recomputed, this leads to 
> chaos. In Python you have both mutable and immutable arrays (called list 
> and tuple), strings are immutable, but with the standard module "array" 
> you can use mutable "strings" too. Python AAs called dict accept only 
> their immutable versions to avoid those bugs (and inside tuples you have 
> to put immutables).

Sounds sound to me. This was what I suggested, use a .access property and 
only accept the 'read-only' for things like that. 




More information about the Digitalmars-d-learn mailing list