Re: how to solve <<error printing object>>

Jacek Podkanski via Sbcl-help <[email protected]> Thu, 2 Apr 2026 00:44:58 +0100
Newsgroups gmane.lisp.steel-bank.general
Message-ID <CAE9ibtoAYFj_iXRbGodg4MPyGqe2qTiFpgVjSAmXDW=XhqxJSA@mail.gmail.com>
--===============1681141668118153793==
Content-Type: multipart/alternative; boundary="000000000000a00589064e6eac96"

--000000000000a00589064e6eac96
Content-Type: text/plain; charset="UTF-8"

I was able to make progress with replacing slot values with todos, but
still do not know how to fix such problems

(defmethod print-object ((obj male) stream)
  (print-unreadable-object (obj stream :type t :identity t)
    (format stream "bbbb ~a"
            (list :name    :todo ;; (~> obj name)
                  :mother  :todo ;; (~> obj mother name)
                  :father  :todo ;; (~> obj father name)
                  :children :todo ;; (loop for c in (~> obj children)
collect (~> c name))
                  :wives  :todo  ;; (loop for w in (~> obj wives) collect
(~> w name))
                  ))))

On Thu, 2 Apr 2026 at 00:40, Jacek Podkanski <[email protected]>
wrote:

> I am looking for guidelines on solving  <<error printing object>> error.
>
> I am trying to learn CLOS parts related to relationships between objects.
>
> I tried to model ancient family relations where some lived in monogamous
> and some polygamous relationships. And it's not simple.
>
> I suspect there is going in circles involved, but I have no idea how to
> solve it.
>
> I can provide full source if needed.
>
> ;;; === classes =================
> (defclass/std arb ()
>   ((id)))
>
> (defclass/std person (arb)
>   ((name :type string)
>    (mother)
>    (father)
>    (children)))
>
> (defclass/std male   (person)
>   ((wives)))
>

--000000000000a00589064e6eac96
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I was able to make progress with replacing slot values wit=
h todos, but still do not know how to fix such problems<div><br></div><div>=
(defmethod print-object ((obj male) stream)<br>=C2=A0 (print-unreadable-obj=
ect (obj stream :type t :identity t)<br>=C2=A0 =C2=A0 (format stream &quot;=
bbbb ~a&quot;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (list :name =C2=
=A0 =C2=A0:todo ;; (~&gt; obj name)<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 :mother =C2=A0:todo ;; (~&gt; obj mother name)<=
br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 :father =
=C2=A0:todo ;; (~&gt; obj father name)<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 :children :todo ;; (loop for c in (~&gt; ob=
j children) collect (~&gt; c name))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 :wives =C2=A0:todo =C2=A0;; (loop for w in (~&g=
t; obj wives) collect (~&gt; w name))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ))))<br></div></div><br><div class=3D"gmail_qu=
ote gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, 2 =
Apr 2026 at 00:40, Jacek Podkanski &lt;<a href=3D"mailto:ruby.object@google=
mail.com">[email protected]</a>&gt; wrote:<br></div><blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid=
 rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr">I am looking for guide=
lines on solving=C2=A0=C2=A0&lt;&lt;error printing object&gt;&gt; error.<di=
v><br></div><div>I am trying to learn CLOS parts related to relationships b=
etween objects.</div><div><br></div><div>I tried to model ancient family re=
lations where some lived in monogamous and some polygamous relationships. A=
nd it&#39;s not simple.=C2=A0</div><div><br></div><div>I suspect there is g=
oing in circles involved, but I have no idea how to solve it.</div><div><br=
></div><div>I can provide full source if needed.</div><div><br></div><div>;=
;; =3D=3D=3D classes =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br=
>(defclass/std arb ()<br>=C2=A0 ((id)))<br><br>(defclass/std person (arb)<b=
r>=C2=A0 ((name :type string)<br>=C2=A0 =C2=A0(mother)<br>=C2=A0 =C2=A0(fat=
her)<br>=C2=A0 =C2=A0(children)))<br><br>(defclass/std male =C2=A0 (person)=
<br>=C2=A0 ((wives)))<br></div></div>
</blockquote></div>

--000000000000a00589064e6eac96--


--===============1681141668118153793==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============1681141668118153793==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Sbcl-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sbcl-help

--===============1681141668118153793==--