On Wed, Dec 17, 2003 at 04:22:13PM +0100, Luke Gorrie wrote:
Brian Downing bdowning@lavos.net writes:
One question I would have is, how is the object accessed once it's clicked on? I imagine CLIM just holds a (weak?) pointer to the object in its presentation. From emacs, you may see "#<FOO {40541D01}>", and even know the address more concretely if its passed in some sort of object-info, but as soon as GC happens, you're likely screwed.
If CLIM used weak references, it would have the same trouble. I would guess they use normal references and normal GC, but I don't know.
Not the way I was thinking about it. What I meant is that the GC would probably move the object, not collect it, and if your reference to it was based on address, it would be broken even though the object still existed.
Weak references make sense to me, even for CLIM, because I really wouldn't want all the objects I've created in the REPL to persist just because their presentations still exist in my scrollback. That completely changes the semantics of working at the REPL. Maybe somebody who has worked on the LispM could explain what semantics presentations in its listener had with respect to garbage collection.
If I print a piece of data that is part of a larger structure, and not garbage, I'd want the presentation to still be able to access it after it has been moved by the GC. But I'd also like to be able to do (progn (print (make-instance 'two-hundred-megabyte-object)) nil) at the REPL and not saddle the GC with any limitations on how to collect this data that nobody else is using, like waiting for it to "time out" or having another 200 presentations created after it.
All IMHO, of course.
-bcd