Re: Finding the applicable methods...
"Robert Goldman (as rpgoldman at sift dot net)" <[email protected]> Wed, 15 Jul 2026 13:57:36 -0500
| Newsgroups | gmane.lisp.lispworks.general |
|---|---|
| Message-ID | <[email protected]> |
--=_MailMate_0F1E75BD-1378-4641-8E01-63D279A098D7_= Content-Type: text/plain; charset=UTF-8; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit The late Drew McDermott (z"l) had a `defobject` macro in his Ytools library specifically to make it easy to move back and forth between different object implementations. I need to go back and see if it can be freed from the full ytools framework to a micro-library on its own. On 15 Jul 2026, at 9:37, Tim Bradshaw (as tfb at cley dot com) wrote: > On 14 Jul 2026, at 23:08, David McClain (as dbm at > refined-audiometrics dot com) <[email protected]> wrote: >> >> Yes, you are right… I reluctantly surrendered to the typed STRUCT, >> aka without (:TYPE VECTOR). >> >> 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 Robert P. Goldman Research Fellow Smart Information Flow Technologies (d/b/a SIFT, LLC) 319 N. First Ave., Suite 400 Minneapolis, MN 55401 Google Voice: (612) 326-3934 Cell: (612) 384-3454 Email: [email protected] --=_MailMate_0F1E75BD-1378-4641-8E01-63D279A098D7_= Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <!DOCTYPE html> <html> <head> <meta http-equiv=3D"Content-Type" content=3D"text/xhtml; charset=3Dutf-8"= > </head> <body><div style=3D"font-family: sans-serif;"><div class=3D"markdown" sty= le=3D"white-space: normal;"> <p dir=3D"auto">The late Drew McDermott (z"l) had a <code style=3D"m= argin: 0 0; padding: 0 0.25em; border-radius: 3px; background-color: #F7F= 7F7;">defobject</code> macro in his Ytools library specifically to make i= t easy to move back and forth between different object implementations. = I need to go back and see if it can be freed from the full ytools framewo= rk to a micro-library on its own.</p> <p dir=3D"auto">On 15 Jul 2026, at 9:37, Tim Bradshaw (as tfb at cley dot= com) wrote:</p> <blockquote style=3D"margin: 0 0 5px; padding-left: 5px; border-left: 2px= solid #777777; color: #777777;"> <p dir=3D"auto">On 14 Jul 2026, at 23:08, David McClain (as dbm at refine= d-audiometrics dot com) <a href=3D"mailto:[email protected]" style=3D= "color: #777777;">[email protected]</a> wrote:</p> <blockquote style=3D"margin: 0 0 5px; padding-left: 5px; border-left: 2px= solid #777777; border-left-color: #999999; color: #999999;"> <p dir=3D"auto">Yes, you are right=E2=80=A6 I reluctantly surrendered to = the typed STRUCT, aka without (:TYPE VECTOR).</p> <p dir=3D"auto">That gives me the chance to use the LW Inspect to show mu= ltiple different views of a RB-TREE, including a nice graphical view, tha= nks to the LW GRAPH pane.</p> </blockquote> <p dir=3D"auto">To beat a dead horse, this is my problem with CLOS.</p> <p dir=3D"auto">I have lots of cases where I started off using, say, a co= ns for some object with two fields (with named accessors defined the obvi= ous 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 st= ructures, 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 <em>print-circle</em> on all the time. Not to mention al= l the methody / typecase goodness. And may be it's slower but it's hard = to measure.</p> <p dir=3D"auto">So I think, "I know, I'll use defclass not defstruct= for even more methody goodness". And now my program is suddenly en= tirely dominated by slot access overhead in any implementation.</p> <p dir=3D"auto">CLOS (in particular subclasses of standard-object) is to = CL what Python is to numerical programming: it's great and all, but you d= on't want it anywhere near your inner loops. I hate Python for that.</p>= <p dir=3D"auto">--tim</p> </blockquote> <p dir=3D"auto">Robert P. Goldman<br> Research Fellow<br> Smart Information Flow Technologies (d/b/a SIFT, LLC)</p> <p dir=3D"auto">319 N. First Ave., Suite 400<br> Minneapolis, MN 55401</p> <p dir=3D"auto">Google Voice: (612) 326-3934<br> Cell: (612) 384-3454<br> Email: <a href=3D"mailto:[email protected]" style=3D"color: #3983C4;"= >[email protected]</a></p> </div> </div> </body> </html> --=_MailMate_0F1E75BD-1378-4641-8E01-63D279A098D7_=-- _______________________________________________ Lisp Hug - the mailing list for LispWorks users [email protected] http://www.lispworks.com/support/lisp-hug.html