Re: Finding the applicable methods...

"Tim Bradshaw (as tfb at cley dot com)" <[email protected]> Wed, 15 Jul 2026 15:37:58 +0100
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
--Apple-Mail=_D5FDD48B-09AB-48C4-B9DF-062A7E317F33
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

On 14 Jul 2026, at 23:08, David McClain (as dbm at refined-audiometrics =
dot com) <[email protected]> wrote:
>=20
> Yes, you are right=E2=80=A6 I reluctantly surrendered to the typed =
STRUCT, aka without (:TYPE VECTOR).=20
>=20
> That gives me the chance to use the LW Inspect to show multiple =
different views of a RB-TREE, including a nice graphical view, thanks to =
the LW GRAPH pane.

To beat a dead horse, this is my problem with CLOS.

I have lots of cases where I started off using, say, a cons for some =
object with two fields (with named accessors defined the obvious way).  =
And at some point I'm trying to debug it and I can't even tell if the =
conses I'm looking at are the ones I think they are.  So I use =
structures, and now I can see what the objects are, I don't need to =
define accessors by hand, and I can do things like controlilng printing =
so I don't have to have *print-circle* on all the time.  Not to mention =
all the methody / typecase goodness.  And may be it's slower but it's =
hard to measure.

So I think, "I know, I'll use defclass not defstruct for even more =
methody goodness".  And now my program is suddenly entirely dominated by =
slot access overhead in any implementation.

CLOS (in particular subclasses of standard-object) is to CL what Python =
is to numerical programming: it's great and all, but you don't want it =
anywhere near your inner loops.  I hate Python for that.

--tim=

--Apple-Mail=_D5FDD48B-09AB-48C4-B9DF-062A7E317F33
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html aria-label=3D"message body"><head><meta http-equiv=3D"content-type" =
content=3D"text/html; charset=3Dutf-8"></head><body =
style=3D"overflow-wrap: break-word; -webkit-nbsp-mode: space; =
line-break: after-white-space;">On 14 Jul 2026, at 23:08, David McClain =
(as dbm at refined-audiometrics dot com) &lt;[email protected]&gt; =
wrote:<br><div><blockquote type=3D"cite"><br =
class=3D"Apple-interchange-newline"><div><meta charset=3D"UTF-8"><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; =
font-size: 11px; font-style: normal; font-variant-caps: normal; =
font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; widows: 2; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;">Yes, you are right=E2=80=A6=
 I reluctantly surrendered to the typed STRUCT, aka without (:TYPE =
VECTOR).<span class=3D"Apple-converted-space">&nbsp;</span></span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; =
font-size: 11px; font-style: normal; font-variant-caps: normal; =
font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; widows: 2; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-line: =
none; text-decoration-thickness: auto; text-decoration-style: =
solid;"><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 11px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; orphans: 2; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration-line: none; text-decoration-thickness: auto; =
text-decoration-style: solid;"><span style=3D"caret-color: rgb(0, 0, 0); =
font-family: Menlo-Regular; font-size: 11px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
orphans: 2; text-align: start; text-indent: 0px; text-transform: none; =
white-space: normal; widows: 2; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;">That gives me the chance to use the LW =
Inspect to show multiple different views of a RB-TREE, including a nice =
graphical view, thanks to the LW GRAPH =
pane.</span></div></blockquote><br></div><div>To beat a dead horse, this =
is my problem with CLOS.</div><div><br></div><div>I have lots of cases =
where I started off using, say, a cons for some object with two fields =
(with named accessors defined the obvious way). &nbsp;And at some point =
I'm trying to debug it and I can't even tell if the conses I'm looking =
at are the ones I think they are. &nbsp;So I use structures, and now I =
can see what the objects are, I don't need to define accessors by hand, =
and I can do things like controlilng printing so I don't have to have =
*print-circle* on all the time. &nbsp;Not to mention all the methody / =
typecase goodness. &nbsp;And may be it's slower but it's hard to =
measure.</div><div><br></div><div>So I think, "I know, I'll use defclass =
not defstruct for even more methody goodness". &nbsp;And now my program =
is suddenly entirely dominated by slot access overhead in any =
implementation.</div><div><br></div><div>CLOS (in particular subclasses =
of standard-object) is to CL what Python is to numerical programming: =
it's great and all, but you don't want it anywhere near your inner =
loops. &nbsp;I hate Python for =
that.</div><div><br></div><div>--tim</div></body></html>=

--Apple-Mail=_D5FDD48B-09AB-48C4-B9DF-062A7E317F33--

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
[email protected]
http://www.lispworks.com/support/lisp-hug.html