Can't print instances without *pretty-print*

Bug #1654550 reported by Stas Boukarev on 2017-01-06
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

(write (make-instance (defclass foo () ())) :pretty nil)
#<unknown pointer object, lowtag=#x3 {103EAA58C3}>

Douglas Katzman (dougk) on 2017-01-06
Changed in sbcl:
assignee: nobody → Douglas Katzman (dougk)
status: Triaged → Fix Committed
Stas Boukarev (stassats) on 2017-01-22
Changed in sbcl:
status: Fix Committed → Fix Released
assignee: Douglas Katzman (dougk) → nobody

Guys, what is the status of this fix? Which version of SBCL will include it?

Stas Boukarev (stassats) wrote :

There was never a version with this bug.

It is strange, because I have it in my SBCL, built with Roswell.

But now I found that it depends on some libraries loaded into the image.

If I start a new lisp image, then this code works:

CL-USER> (defclass person () ((name :initarg :name :reader person-name)))
CL-USER> (make-instance 'person :name "Peter")
#<PERSON {1002C9DE23}>
CL-USER> (lisp-implementation-version)

But if I load my project, which uses weblocks and it's dependencies, then I get:

PLAYGROUND> (defclass person () ((name :initarg :name :reader person-name)))
PLAYGROUND> (make-instance 'person :name "Peter")
#<unknown pointer object, lowtag=#x3 {1008B3CAA3}>
PLAYGROUND> (lisp-implementation-type)
PLAYGROUND> (lisp-implementation-version)

Stas Boukarev (stassats) wrote :

weblocks defines a print-object method on standard-object, which isn't allowed.
(defmethod print-object ((obj standard-object) stream) (call-next-method))
(write (make-instance (defclass foo () ())) :pretty nil)
#<unknown pointer object, lowtag=#x3 {1003EDA583}>

Agrrhh! I'll let it's maintainer know :)

Stas Boukarev (stassats) wrote :

And if they are insisting on doing that, at least make it an :around method. But it's still a bad idea either way.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers