<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 7/17/2024 11:08 AM, Mark Volkmann via Cuis-dev wrote:
<blockquote
cite="mid:CAFfRWnUP9hVZLfbiP+QWHZL+qYvemPxbX0GuOPup9eQcQRFx7g@mail.gmail.com"
type="cite">
<div dir="ltr">
<div dir="ltr">When I enter the following lines in a Workspace,
select them, and "Do it", I get an AssertionFailure error:
<div><br>
</div>
<div><font face="monospace">str1 := 'test'.<br>
str2 := 'test'.<br>
self assert: str1 ~~ str2.</font><br>
</div>
<div><br>
</div>
<div>Ken, are you saying that you do not get that error?</div>
</div>
<div><br>
</div>
<span class="gmail_signature_prefix">-- </span><br>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr">
<div><font face="arial, helvetica, sans-serif">R.
Mark Volkmann</font></div>
<div><span style="font-size: 12.8px;"><font
face="arial, helvetica, sans-serif">Object
Computing, Inc.</font></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
Side comment: an AssertionFailure is an Exception but not an Error
(see class hierarchy).<br>
<br>
You get the AssertionFailure if you select all three lines and
evaluate them together, but not if you evaluate them one by one.<br>
<br>
Truth is that str1 and str2 can not be assumed to be the same
object. But they can not be assumed to be different object either.
The compiler is free to reuse the string if it is easy enough.<br>
<br>
Cheers,<br>
<pre class="moz-signature" cols="72">--
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich</pre>
</body>
</html>