"Mystifier" <mystifier / users.berlios.de> schrieb im Newsbeitrag
news:000901c4f9a0$899eb620$1a87103d / vubydump...

> I saw few last posts by matz categorically saying that strings shall be
> mutable.
>
> I have nothing against or for it as a language specification. What
interests
> me that if string are immutable, we can use strings as symbols. This can
> bring about few important effects on VM.
>
> 1) Symbols and FixNum have few exceptions to the usual rules. Symbols
may
> not have any exceptions, since symbol and strings will be basically
same.

Do you mean that the current restrictions of Symbol will no longer apply?

> 2) Efficiency of VM will improve because Symbols and Strings can be used
> interchangeably.

Not necessarily: you can see with a Java VM that efficiency of the
application degrades if you have many string manipulations that use String
instead of a more suited class (StringBuffer for example).  The same will
happen in Ruby if you need to create a new object for each mutated string.

> 3) It might help on security, perhaps.

Ruby has already #freeze and $SAFE.  What additional security do we gain?

> A Mutable string class can be created for mutating strings.

I don't understand what we gain by this.  We have this situation already:

    - Symbols and frozen Strings are immutable

    - Other Strings are mutable

With the added benefit that Symbols are unique: there is at most one
Symbol instance representing a certain character sequence.

> No, I am not trying to create another java, but as Users, how many times
> have you mutated your strings?

Often enough to say it's a very common scenario.

Regards

    robert