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

PP'ing interpreted OBJECTs...



PP does something strange with OBJECTs, as illustrated by the following
transcript.  Am I doing the right thing?  How do I get a non-compiled OBJECT
to PP correctly?


> (define foo (object (lambda () 'value-of-foo)
                      ((identification self) 'foo)
                      ((print self stream) (format stream "#{FOO}"))))
[Defining FOO] #{FOO}
> (pp foo)


** Error: operation not handled
  (COMPILED-CODE-SOURCE ())
>> *** EOF *** 

;; Adding a PRETTY-PRINT method doesn't help.
;; ------------------------------------------

> (define foo (object (lambda () 'value-of-foo)
                      ((identification self) 'foo)
                      ((print self stream) (format stream "#{FOO}"))
                      ((pretty-print self stream) (format stream "#{FOO}"))))
[Redefining FOO] #{FOO}
> (pp foo)


** Error: operation not handled
  (COMPILED-CODE-SOURCE ())

>> (procedure? foo)
T



It seems to me that T thinks FOO is a procedure and so tries to do a
WHERE-DEFINED on it when I try to PP it.  Shouldn't PP first look for
a PRETTY-PRINT method, or at least be smart enough not to look for the
WHERE-DEFINED of a interpreted object?  Or did I do something wrong?

-- Ashwin.

-------