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

Object Printing Discussion



    Date: Wed, 13 May 87 08:56:15 pdt
    From: Jim Kempf <kempf%hplabsc@hplabs.HP.COM>

    1) CLOS should specify a default printable object representation which
    is readable again, if only because programmers find it useful.

The point is that it's not clear what "readable" means, and how useful
it is.  You'd have to be more careful about how this is defined.  What
if the value of one of the slots is a compiled code object?  But even if
all the values are symbols, you still have to make sure that people
realize that reading this printed representation can only be said to
"create a new instance which, in some respects, is like the instance
that got printed", which isn't really guaranteeing very much.

    2) This representation should be ASCII and should use existing Common Lisp 
    read macros where possible, to facilitate portability and backward 
    compatibility.

(Not ASCII, but the CL character set, which is more restrictive than
that.  Portability to the 370, remember.)

    4) The hooks should be part of the metaobject protocol, since the
    metaobject protocol controls the representation of classes and
    instances.

I don't agree with this; it would be a real pain in the neck, and
overkill, to have to define a whole new metaclass just to say how an
instance is printed.  Defining a method is far easier.