[cl-graph-devel] printing readably and presentation question (SBCL + MCCLIM + CL-GRAPH)

John Morrison morrison at mak.com
Sun Feb 12 19:19:24 UTC 2006


Hi;

Apologies in advance if this turns out to be a "stupid newbie"
question (and there is great potential for it to be a three-way newbie
question: CLOS, cl-graph, and/or CLIM/McCLIM):

I am trying to write a McCLIM application which includes a graphical
editor for cl-graph based data structures (Linux+SBCL).

When I try to use accepting-values to accept an instance of a class
derived from cl-graph:basic-vertex, it seems that the "print-object"
method of basic-vertex ends up producing something that confuses the
"accept" machinery:

(defmethod print-object ((vertex basic-vertex) stream)
  (print-unreadable-object (vertex stream :identity nil)
    (format stream "~A" 
            (if (and (slot-exists-p vertex 'element) (slot-boundp vertex 
'element))
              (element vertex) "#unbound#"))))

--- cut here ---

accepting-values accept condition: Error parsing "#<vtx10515>" for 
presentation type vtx

--- cut here ---

I tried setting *print-readably* to t (from nil), but the obvious
thing happened (print-not-readable error) when it hit the
print-unreadable-object.

If (a big "if," I know) this is the case, what is the best stylistic
way to handle this?

1. Define my own print-object primary method which prints readably?
If so, what does a reasonably portable version look like?

2. Define an around method that doesn't call-next-method?  

3. Attempt some weird method-combination voodoo?

4. Something else entirely?

Thanks!

-jm

-- 
==== John Morrison
==== MAK Technologies Inc.
==== 68 Moulton Street, Cambridge, MA 02138
==== http://www.mak.com/
==== vox:617-876-8085 x115
==== fax:617-876-9208
==== jm at mak.com




More information about the cl-graph-devel mailing list