Subject: Re: print-object on hash-tables...
From: Erik Naggum <erik@naggum.no>
Date: 1999/01/27
Newsgroups: comp.lang.lisp
Message-ID: <3126389253563451@naggum.no>

* David Bakhash <cadet@mit.edu>
| This question really isn't only for hash-tables, as what I want to know
| is what the: @ #x9c221a is for.  I suppose it's the address of the
| hash-table, but I thought that that would be useless to a Lisp
| programmer, so why would they tell you that?

  it is indeed the machine address of the object.  this is what the
  :IDENTITY argument to PRINT-UNREADABLE-OBJECT gives you.

(print-unreadable-object (nil nil :type t :identity t))
-| #<null @ #x20000985>

  it is sometimes useful to know whether you have different somethings that
  otherwise look exactly the same.

(make-hash-table)
=> #<eql hash-table with 0 entries @ #x21433aca>
(make-hash-table)
=> #<eql hash-table with 0 entries @ #x21433fd2>

  the value is not necessarily useful across a garbage collection, so it
  does have fairly limited use, but there's always something to be said for
  visual inspection.

  if you don't like it, the following piece of advice will turn it off.

(advise excl::print-unreadable-object-1 :before no-identity nil
  (setf (fourth arglist) nil))

  you will now observe this behavior, instead:

(print-unreadable-object (nil nil :type t :identity t))
-| #<null>
  
#:Erik
-- 
  SIGTHTBABW: a signal sent from Unix to its programmers at random
  intervals to make them remember that There Has To Be A Better Way.