[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing printnames



M. Timur Friedman (friedman@cs.umass.edu) wrote:
: I have noticed that objects will sometimes spontaneously change their
: print names in MCL 2.0p2 on a MacIIx.

: For example, I have a class of objects called answer-node.  I have not
: defined a print-object method for answer-node. While my program is
: running, it prints out statements such as:

:   Moving node #<ANSWER-NODE #x4E21A1>

: However, when I use the inspector later to look at the same object, it
: is has a different name: #<ANSWER-NODE #x4DF259>.

That stuff after the "answer-node" is the address, I believe.  Because
objects can move in memory after a gc the name printed out might look
different at different times.  e.g.

? (setq baz (make-instance 'window))
#<WINDOW "Untitled" #x54AFF1>
? (gc)
NIL
? baz
#<WINDOW "Untitled" #x5092A1>
? baz
#<WINDOW "Untitled" #x5092A1>
? (gc)
NIL
? baz
#<WINDOW "Untitled" #x509269>

The object itself hasn't changed.

-David

--
neves@ils.nwu.edu
Institute for the Learning Sciences, 1890 Maple, Evanston Il 60201