On Sat, Aug 26, 2023 at 11:56:42AM -0400, Todd Coram wrote:
> Of course, tracking every object instantiation that gets stuffed into the
> HashArray isn't trivial,

The opposite (i.e. which objects are still referenced from Lisp) is easy though:

   (filter
      '((Obj) (== 32769 (car (id Obj T))))
      (all 0) )

This returns a List of all accessible Java objects.


> It seems that any object returned by a Java method call is subject to be 
> placed
> there so calls like (java (java someobject 'getResultingObject) 'doSomething))
> will place the inner object in the HashArray, correct?

Yes. The call inserts the result of (java someobject ...) into the hashmap, and
perhaps also the result of the outer 'java' call if it is an object.

For example,

   : (java "java.io.File" T "name")
   -> {H@@@10327432}

inserts *one* new object.

If that object's internals are accessed, for example by

   : (show @)
   {H@@@10327432} ({H@@@751603011} . "java.io.File")
      filePath NIL
      path "name"
      prefixLength 0
      status NIL
      fs {H@@@1172500016}
      pathSeparator ":"
      pathSeparatorChar 58
      separator "/"
      separatorChar 47
      serialVersionUID 301077366599181567
   -> {H@@@10327432}

then also all objects referred by it (i.e. {H@@@751603011} and {H@@@1172500016}
will be inserted.

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to