[Cuis-dev] Voiceless regarding behavior of statePointsTo:

Hilaire Fernandes hfern at free.fr
Sat Jul 1 03:24:31 PDT 2023


Le 01/07/2023 à 12:15, Hilaire Fernandes a écrit :
>
> Is it the expected behavior?
>
I guess so.

I implemented my own variant to search, does not check circular 
reference though:

treePointsTo:  anObject
" Are my instances and sub instances hold a reference of anObject"
	^  (self  statePointsTo:  anObject)or:  [|attributesToVisit  |
		attributesToVisit  :=  OrderedCollection  new.
		1  to:  self  class  instSize  do:  [:i  |
			(self  instVarAt:  i)isCollection  ifTrue:  [attributesToVisit  addAll:  (self  instVarAt:  i)] ].
		attributesToVisit  anySatisfy:  [:attribute  |  
			attribute  ==  anObject  or:  [attribute  treePointsTo:  anObject] ] ]

-- 
GNU Dr. Geo
http://drgeo.eu
http://blog.drgeo.eu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230701/474c7a75/attachment.htm>


More information about the Cuis-dev mailing list