<!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/1/2023 7:24 AM, Hilaire Fernandes via Cuis-dev wrote:
<blockquote cite="mid:1d8370fa-b08b-d021-7cfc-36ad08cc740a@free.fr"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div class="moz-cite-prefix">Le 01/07/2023 à 12:15, Hilaire
Fernandes a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:4e017b63-0a37-8dad-e3ab-05ff2acf1e70@free.fr">
<p>Is it the expected behavior?<br>
</p>
</blockquote>
<p>I guess so. <br>
</p>
</blockquote>
<br>
Yep.<br>
<br>
<blockquote cite="mid:1d8370fa-b08b-d021-7cfc-36ad08cc740a@free.fr"
type="cite">
<p> </p>
<p>I implemented my own variant to search, does not check circular
reference though:</p>
<div style="background: none repeat scroll 0% 0% rgb(255, 255,
255); overflow: auto; width: auto; border-style: solid;
border-color: gray; border-width: 0.1em 0.1em 0.1em 0.8em;
padding: 0.2em 0.6em;">
<pre style="margin: 0pt; line-height: 125%;"><span style="color: rgb(0, 102, 187); font-weight: bold;">treePointsTo:</span> <span style="color: rgb(153, 102, 51);">anObject</span>
<span style="color: rgb(136, 136, 136);">" Are my instances and sub instances hold a reference of anObject"</span>
<span style="color: rgb(51, 51, 51);">^</span> (<span style="color: rgb(0, 112, 32);">self</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">statePointsTo:</span> <span style="color: rgb(153, 102, 51);">anObject</span>) <span style="color: rgb(0, 102, 187); font-weight: bold;">or:</span> [ <span style="color: rgb(51, 51, 51);">|</span><span style="color: rgb(153, 102, 51);">attributesToVisit</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">|</span>
<span style="color: rgb(153, 102, 51);">attributesToVisit</span> <span style="color: rgb(51, 51, 51);">:=</span> <span style="color: rgb(187, 0, 102); font-weight: bold;">OrderedCollection</span> <span style="color: rgb(0, 112, 32);">new</span>.
<span style="color: rgb(102, 0, 238); font-weight: bold;">1</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">to:</span> <span style="color: rgb(0, 112, 32);">self</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">class</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">instSize</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">do:</span> [<span style="color: rgb(51, 51, 51);">:</span><span style="color: rgb(153, 102, 51);">i</span> <span style="color: rgb(51, 51, 51);">|</span>
(<span style="color: rgb(0, 112, 32);">self</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">instVarAt:</span> <span style="color: rgb(153, 102, 51);">i</span>) <span style="color: rgb(0, 102, 187); font-weight: bold;">isCollection</span> <span style="color: rgb(0, 112, 32);">ifTrue:</span> [ <span style="color: rgb(153, 102, 51);">attributesToVisit</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">addAll:</span> (<span style="color: rgb(0, 112, 32);">self</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">instVarAt:</span> <span style="color: rgb(153, 102, 51);">i</span>)] ].
<span style="color: rgb(153, 102, 51);">attributesToVisit</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">anySatisfy:</span> [<span style="color: rgb(51, 51, 51);">:</span><span style="color: rgb(153, 102, 51);">attribute</span> <span style="color: rgb(51, 51, 51);">|</span>
<span style="color: rgb(153, 102, 51);">attribute</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">==</span> <span style="color: rgb(153, 102, 51);">anObject</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">or:</span> [<span style="color: rgb(153, 102, 51);">attribute</span> <span style="color: rgb(0, 102, 187); font-weight: bold;">treePointsTo:</span> <span style="color: rgb(153, 102, 51);">anObject</span>] ] ]
</pre>
</div>
<p><!-- HTML generated using hilite.me --></p>
<pre class="moz-signature" cols="72">--
GNU Dr. Geo
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://drgeo.eu">http://drgeo.eu</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://blog.drgeo.eu">http://blog.drgeo.eu</a></pre>
</blockquote>
<br>
That is a bit more expensive than needed, because of the creation of
a collection. Moreover, I wonder, why do you need this?<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>