[Cuis-dev] String vs Symbol objects

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Wed Jul 17 08:11:00 PDT 2024


It's possible that the compiler optimize and create a single literal rather
than several equal literals.

If you evaluate each line separately in the workspace, the result of
assertion will be different.

Try eith str1 := 'test' copy.
If you don't want the resilt to depend on some compiler optimisation

Nicolas

Le mer. 17 juil. 2024, 17:08, Mark Volkmann via Cuis-dev <
cuis-dev at lists.cuis.st> a écrit :

> When I enter the following lines in a Workspace, select them, and "Do it",
> I get an AssertionFailure error:
>
> str1 := 'test'.
> str2 := 'test'.
> self assert: str1 ~~ str2.
>
> Ken, are you saying that you do not get that error?
>
> --
> R. Mark Volkmann
> Object Computing, Inc.
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240717/424b22c3/attachment.htm>


More information about the Cuis-dev mailing list