Can't print instances without *pretty-print*

Bug #1654550 reported by Stas Boukarev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
High
Unassigned

Bug Description

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

Tags: printer
Douglas Katzman (dougk)
Changed in sbcl:
assignee: nobody → Douglas Katzman (dougk)
status: Triaged → Fix Committed
Stas Boukarev (stassats)
Changed in sbcl:
status: Fix Committed → Fix Released
assignee: Douglas Katzman (dougk) → nobody
Revision history for this message
Alexander Artemenko (svetlyak40wt) wrote :

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

Revision history for this message
Stas Boukarev (stassats) wrote :

There was never a version with this bug.

Revision history for this message
Alexander Artemenko (svetlyak40wt) wrote :

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

Revision history for this message
Alexander Artemenko (svetlyak40wt) wrote :

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)))
#<STANDARD-CLASS COMMON-LISP-USER::PERSON>
CL-USER> (make-instance 'person :name "Peter")
#<PERSON {1002C9DE23}>
CL-USER> (lisp-implementation-version)
"1.3.16"
CL-USER>

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)))
#<STANDARD-CLASS PLAYGROUND::PERSON>
PLAYGROUND> (make-instance 'person :name "Peter")
#<unknown pointer object, lowtag=#x3 {1008B3CAA3}>
PLAYGROUND> (lisp-implementation-type)
"SBCL"
PLAYGROUND> (lisp-implementation-version)
"1.3.16"

Revision history for this message
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}>

Revision history for this message
Alexander Artemenko (svetlyak40wt) wrote :

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

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.