[Glass] How replace in String works

Dale Henrichs dale.henrichs at gemtalksystems.com
Wed Jan 15 09:55:39 PST 2020


Bruno,

In GemStone, literal strings and array are created invariant. As you 
have discovered a copy of the string is not invariant, so if you are 
created literal strings  that you intend to modify then you should do 
the copy at creation time ...

Dale

On 1/15/20 8:56 AM, BrunoBB via Glass wrote:
> Hi,
> GS 3.4.1
>
> Why:
> '123'  at: 3 put: $4; yourself.        "rise an exception"
> '123' copy at: 3 put: $4; yourself   "works ok"
>
> My problem was using replaceAll:with: but the "culprit" was at:put: in
> Strings.
>
> '123' copy isInvariant "answer false"
> '123' isInvariant "answer true"
>
> regards,
> bruno
>
>
>
> --
> Sent from: http://forum.world.st/GLASS-f1460844.html
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com
> https://lists.gemtalksystems.com/mailman/listinfo/glass


More information about the Glass mailing list