[Cuis-dev] String vs Symbol objects

Mark Volkmann r.mark.volkmann at gmail.com
Wed Jul 17 14:17:02 PDT 2024


On Wed, Jul 17, 2024 at 3:50 PM <ken.dickey at whidbey.com> wrote:

> On 2024-07-17 07:08, Mark Volkmann via Cuis-dev wrote:
>
> > 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?
>
> Yes.  For me `str1 ~~ str2` --> true
>

Are you executing the three lines one at a time or are you selecting all
three and running "Do it"?
Apparently when they are executed individually, the compiler doesn't
optimize to make str1 and str1 refer to the same String in memory.
But when you run all the lines together, the compiler decides that they can
share the object and the assertion fails.

-- 
R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240717/956c69d7/attachment.htm>


More information about the Cuis-dev mailing list