[cl-graph-devel] how to subclass vertices, too?

John Morrison jm at mak.com
Fri Feb 10 15:39:06 UTC 2006


Hi Gary;

Thanks again for both the help and the software...

I just want to make sure that I didn't do this the Wrong Way, and the
following question is also intended to sanity check my approach...

On Tuesday 07 February 2006 08:51 pm, Gary King wrote:
> Hi John,
>
> Use can use the :vertex-class initarg when creating a graph (or as
> a :default-initarg when subclassing) to change the vertex type. E.g.
>
> (make-instance 'graph-container :vertex-class 'my-happy-vertex)

Would you believe that:

(1) I needed to make "my-happy-vertex" subclass
"graph-container-vertex" in order for things to work?

(2) When so subclassing the vertex class, I have to set the "element"
slot to be something unique?  Failure to do so seemed to confuse the
duplicate-prevention machinery.  In fact, I didn't set it at all so it
was nil (obviously I didn't see this coming), and then things got
weird as only one of my nil "elemented" vertices was added...

And in the immortal words of Hunter S. Thompson, "when the going gets
weird, the weird turn pro."

Thanks again,

-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