toad.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon server operated by David Troy, a tech pioneer and investigative journalist addressing threats to democracy. Thoughtful participation and discussion welcome.

Administered by:

Server stats:

310
active users

#clos

0 posts0 participants0 posts today
lispm<p><span class="h-card" translate="no"><a href="https://fosstodon.org/@amoroso" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>amoroso</span></a></span> <a href="https://mastodon.social/tags/clos" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>clos</span></a> <a href="https://mastodon.social/tags/commonlisp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>commonlisp</span></a> <a href="https://mastodon.social/tags/oop" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>oop</span></a> <a href="https://mastodon.social/tags/lisp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>lisp</span></a> there was still a choice between various proposals then...</p><p>But the actual CLOS was not far away - the standard proposal was published in September 1988: <a href="https://dl.acm.org/toc/sigplan/1988/23/SI" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">dl.acm.org/toc/sigplan/1988/23</span><span class="invisible">/SI</span></a> <br>Available above as a PDF. The final version was then published with the ANSI CL standard.</p>
Paolo Amoroso<p>I'm looking to study CLOS code that is well designed, well documented, _and_ makes idiomatic use of mixin classes. Any recommendations other than the usual Common Lisp and CLOS books?</p><p><a href="https://fosstodon.org/tags/clos" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>clos</span></a> <a href="https://fosstodon.org/tags/CommonLisp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CommonLisp</span></a> <a href="https://fosstodon.org/tags/lisp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>lisp</span></a></p>
Paul SomeoneElse<p>I don't know when to use defgeneric in <a href="https://mastodon.sdf.org/tags/CLOS" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CLOS</span></a> code.</p><p><a href="https://mastodon.sdf.org/tags/commonlisp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>commonlisp</span></a> </p><p>I just write defmethod forms by themselves.</p>
vintage screwlisp account<p><a href="https://mastodon.sdf.org/tags/programming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programming</span></a> <a href="https://mastodon.sdf.org/tags/techDiscussion" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>techDiscussion</span></a> of <a href="https://mastodon.sdf.org/tags/commonLisp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>commonLisp</span></a> on <a href="https://mastodon.sdf.org/tags/itch_io" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>itch_io</span></a> .<br><a href="https://lispy-gopher-show.itch.io/moonclimb/devlog/791188/what-we-get-out-of-lisp" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">lispy-gopher-show.itch.io/moon</span><span class="invisible">climb/devlog/791188/what-we-get-out-of-lisp</span></a></p><p>: A short pamphlet about what I think you get out of lisp. Namely <a href="https://mastodon.sdf.org/tags/loop" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>loop</span></a> <a href="https://mastodon.sdf.org/tags/format" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>format</span></a> <a href="https://mastodon.sdf.org/tags/clim" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>clim</span></a> <a href="https://mastodon.sdf.org/tags/clos" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>clos</span></a> <a href="https://mastodon.sdf.org/tags/conditions" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>conditions</span></a> ie <a href="https://mastodon.sdf.org/tags/iteration" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>iteration</span></a> <a href="https://mastodon.sdf.org/tags/prettyPrinting" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>prettyPrinting</span></a> <a href="https://mastodon.sdf.org/tags/GUI" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>GUI</span></a> <a href="https://mastodon.sdf.org/tags/oop" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>oop</span></a> <a href="https://mastodon.sdf.org/tags/notCrashing" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>notCrashing</span></a></p><p>When I remember how to get any of my tildes back I will gopher the org doc.</p>
vintage screwlisp account<p><a href="https://toobnix.org/w/cYv47BY8FtprzhpHLpiVeY" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">toobnix.org/w/cYv47BY8FtprzhpH</span><span class="invisible">LpiVeY</span></a><br><a href="https://mastodon.sdf.org/tags/commonLisp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>commonLisp</span></a> <a href="https://mastodon.sdf.org/tags/programming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programming</span></a> <a href="https://mastodon.sdf.org/tags/detailed" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>detailed</span></a> <a href="https://mastodon.sdf.org/tags/intro" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>intro</span></a> to <a href="https://mastodon.sdf.org/tags/ASDF" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ASDF</span></a> and <a href="https://mastodon.sdf.org/tags/CLIM" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CLIM</span></a> in <a href="https://mastodon.sdf.org/tags/emacs" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>emacs</span></a> 18 minutes. Touches <a href="https://mastodon.sdf.org/tags/CLOS" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CLOS</span></a>. </p><p>This <a href="https://mastodon.sdf.org/tags/video" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>video</span></a> covers the <a href="https://mastodon.sdf.org/tags/breadAndButter" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>breadAndButter</span></a> of programming in my view. I'll write this up later.</p><p>In the context of starting to draft <a href="https://mastodon.sdf.org/tags/LAFS" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>LAFS</span></a>, but that's ancillary to the what-programming-actually-consists-of content. LAFS: <a href="https://lispy-gopher-show.itch.io/lisp-game-soft-cons" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">lispy-gopher-show.itch.io/lisp</span><span class="invisible">-game-soft-cons</span></a></p><p>If you need 5 minutes of first steps in this direction first, I think this video satisfies that: <a href="https://toobnix.org/w/2WYHBTHGvRQ8pUSVmKhKGg" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">toobnix.org/w/2WYHBTHGvRQ8pUSV</span><span class="invisible">mKhKGg</span></a></p>
vintage screwlisp account<p>Sorry about the <a href="https://mastodon.sdf.org/tags/video" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>video</span></a> flood. I think these 5 minute videos are more useful, but I guess they happen in the context of the lengthy naturalistic wandering.</p><p><a href="https://toobnix.org/w/cZq8pXSBvvmvYeTVHr6utJ" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">toobnix.org/w/cZq8pXSBvvmvYeTV</span><span class="invisible">Hr6utJ</span></a><br><a href="https://mastodon.sdf.org/tags/clim" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>clim</span></a> <a href="https://mastodon.sdf.org/tags/gui" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>gui</span></a> application frame; an interactor and four panes controlled by lambdas displaying slots from a parent class. <a href="https://mastodon.sdf.org/tags/clos" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>clos</span></a> as well I guess. <a href="https://mastodon.sdf.org/tags/CommonLisp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CommonLisp</span></a>. I'm trying to get something finished today =_=.</p>
vintage screwlisp account<p><a href="https://mastodon.sdf.org/tags/lisp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>lisp</span></a> <a href="https://mastodon.sdf.org/tags/clim" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>clim</span></a> <a href="https://mastodon.sdf.org/tags/clos" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>clos</span></a> <a href="https://mastodon.sdf.org/tags/solution" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>solution</span></a> (originally, I was going to whine about a <a href="https://mastodon.sdf.org/tags/problem" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>problem</span></a>).<br>Sorry, deep <a href="https://mastodon.sdf.org/tags/commonLisp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>commonLisp</span></a> </p><p>The problem was that I wanted to shared-initialize :after some button-panes in a table-pane generated by tabling. The list given to tabling is used as :initial-contents to make-array an exported slot, array. I wanted to use slot-values of the initialized application-frame. The solution was to use :default-initargs for the application-frame slots which are available in shared-initialize.</p>
Chief TWiT :twit:<p>I've completed "Pulse Propagation" - Day 20 - Advent of Code 2023 <a href="https://twit.social/tags/AdventOfCode" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>AdventOfCode</span></a> <a href="https://adventofcode.com/2023/day/20" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="">adventofcode.com/2023/day/20</span><span class="invisible"></span></a></p><p>Yes I'm still plugging away. Used OOP for this one, specifically Common Lisp's CLOS. Very elegant!</p><p><a href="https://github.com/leolaporte/aoc-cl/blob/main/2023/Day_20/Day_20.lisp" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/leolaporte/aoc-cl/b</span><span class="invisible">lob/main/2023/Day_20/Day_20.lisp</span></a></p><p><a href="https://twit.social/tags/AOC" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>AOC</span></a> <a href="https://twit.social/tags/Lisp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Lisp</span></a> <a href="https://twit.social/tags/CLOS" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CLOS</span></a></p>
technicat<p>Sometimes I miss the <a href="https://universeodon.com/tags/clos" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>clos</span></a> before/after/around methods</p>
fresco<p>This book was written in 1991. I inherited this copy from someone I met in 1991 as well. (He became a friend and mentor).</p><p>This is such a good read. Light &amp; clear...reminiscence from the past.<br><a href="https://mastodon.social/tags/OOP" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>OOP</span></a> <a href="https://mastodon.social/tags/Lisp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Lisp</span></a> <a href="https://mastodon.social/tags/CLOS" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CLOS</span></a></p>
LisPi<p><span class="h-card"><a class="u-url mention" href="https://pleroma.envs.net/users/winter" rel="nofollow noopener noreferrer" target="_blank">@<span>winter</span></a></span> Its object-orientation model sucks (most languages' sucks, so it's not remotely close to being alone there) and its lack of macros means that you cannot actually fix syntax problems in Java yourself (including gratuitous boilerplate).</p><p>You have to go and beg Oracle (who'll respond with "fuck off") to fix it for you.</p><p><a class="hashtag" href="https://udongein.xyz/tag/kawa" rel="nofollow noopener noreferrer" target="_blank">#Kawa</a> <a class="hashtag" href="https://udongein.xyz/tag/scheme" rel="nofollow noopener noreferrer" target="_blank">#Scheme</a> is essentially what Java should've been (it doesn't <em>yet</em> have a <a class="hashtag" href="https://udongein.xyz/tag/clos" rel="nofollow noopener noreferrer" target="_blank">#CLOS</a> clone, but you could very much port one to it).</p>
LisPi<span class="h-card"><a class="u-url mention" href="https://pleroma.envs.net/users/Seirdy" rel="nofollow noopener noreferrer" target="_blank">@<span>Seirdy</span></a></span> <span class="h-card"><a class="u-url mention" href="https://pleroma.envs.net/users/winter" rel="nofollow noopener noreferrer" target="_blank">@<span>winter</span></a></span> <span class="h-card"><a class="u-url mention" href="https://hachyderm.io/@hrefna" rel="nofollow noopener noreferrer" target="_blank">@<span>hrefna</span></a></span> Worth asking, do you dislike the forced encapsulation of Java-style OOP or do you actually dislike OOP? Those aren't the same.<br><br>The <a class="hashtag" href="https://udongein.xyz/tag/clos" rel="nofollow noopener noreferrer" target="_blank">#CLOS</a> approach (multimethods/generic) where classes are truly nothing more than data containers and methods can dispatch on *any* type combinations including classes doesn't tend to lead to the former's pathological cases, in my experience.<br><br>Although Lisp is a lot more pleasant to write with a dynamic editor, you can write it in vim if you want.<br><br>(I'd also recommend not making :program-op builds for images or compressing them - at least as SBCL goes -, as that prevents the friendly page-sharing and paging otherwise possible.)
vintage screwlisp account<p><span class="h-card"><a href="https://emacs.ch/@louis" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>louis</span></a></span> so I wanted to write about the importance and tradition of using <a href="https://mastodon.sdf.org/tags/closer2mop" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>closer2mop</span></a> to change the meaning of standard-class <a href="https://mastodon.sdf.org/tags/CLOS" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CLOS</span></a> objects to refer to persistent objects supported by a database backend instead of connecting to a database as a design priority.</p><p>Basically I think it's nuts to send SQL to a database via a database connector within a program in the real language of the program, as it were. The SQL connector stuff is a regretful part of the available low level database infrastructure</p>
LisPi<p><span class="h-card"><a href="https://toot.party/@steph" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>steph</span></a></span> They should've just ported <a href="https://mastodon.top/tags/GOOPS" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>GOOPS</span></a> from <a href="https://mastodon.top/tags/Guile" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Guile</span></a> (for one reasonably-good <a href="https://mastodon.top/tags/CLOS" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CLOS</span></a> clone added after the fact).</p><p><a href="https://mastodon.top/tags/OOP" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>OOP</span></a></p>
LisPi<p><a href="https://en.wikipedia.org/wiki/Entity_component_system#Characteristics" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">en.wikipedia.org/wiki/Entity_c</span><span class="invisible">omponent_system#Characteristics</span></a></p><p>&gt; This eliminates the ambiguity problems of deep and wide inheritance hierarchies often found in Object Oriented Programming techniques that are difficult to understand, maintain, and extend. Common ECS approaches are highly compatible with, and are often combined with, data-oriented design techniques.</p><p>I'm sorry what? Generics and multi-methods <a href="https://mastodon.top/tags/ObjectOriented" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ObjectOriented</span></a> systems (<a href="https://en.wikipedia.org/wiki/Multiple_dispatch" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">en.wikipedia.org/wiki/Multiple</span><span class="invisible">_dispatch</span></a>) have no such problem.</p><p><a href="https://functional.cafe/@awkravchuk/110490845045463704" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">functional.cafe/@awkravchuk/11</span><span class="invisible">0490845045463704</span></a></p><p><a href="https://mastodon.top/tags/CLOS" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CLOS</span></a> <a href="https://mastodon.top/tags/CommonLisp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CommonLisp</span></a> <a href="https://mastodon.top/tags/Wikipedia" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Wikipedia</span></a></p>
mousebot<p><a href="https://todon.nl/tags/emacs" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>emacs</span></a> <a href="https://todon.nl/tags/mastodonEl" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>mastodonEl</span></a></p><p>i was playing around with using EIEIO and jeison.el for mastodon.el, but ran into this problem: how to have a slot on an object that contains a list of objects: <a href="https://emacs.stackexchange.com/questions/77383/hold-a-list-of-objects-in-the-slot-of-another-object" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">emacs.stackexchange.com/questi</span><span class="invisible">ons/77383/hold-a-list-of-objects-in-the-slot-of-another-object</span></a>. perhaps someone around here knows EIEIO or CLOS or just OOP and has an idea? maybe it can't be done?</p><p>i was also struggling to have a slot hold an object of the same class as itself (i.e. for mastodon, a boost is a status with a 'reblog' field containing the original status).</p><p>by contrast, a status object can have an account object in a slot, no problems.</p><p><a href="https://todon.nl/tags/lisp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>lisp</span></a> <a href="https://todon.nl/tags/clos" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>clos</span></a></p>
blake shaw 🇵🇸<p><span class="h-card"><a href="https://functional.cafe/@PaniczGodek" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>PaniczGodek</span></a></span> oh really? to me they are like the bread and butter. when you build good records and structure your programs around them, your flexibility increases dramatically as you have these quasi-"intermediate representations" that are extensible and easy + performant to handle. many schemes use records as their fundamental underlying data representation, including <a href="https://functional.cafe/tags/guile" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>guile</span></a> and I believe <a href="https://functional.cafe/tags/chez" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>chez</span></a> as well. and I think <a href="https://functional.cafe/tags/r6rs" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>r6rs</span></a> record protocols make them both extremely extensible and parametric, as well as <a href="https://functional.cafe/tags/guix" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>guix</span></a>'s define-record-type* lazy records which serve a similar purpose with a lot less cognitive overhead.</p><p>lots of cool record systems out there, I'm interested in understanding the tradeoffs of <a href="https://functional.cafe/tags/gauche" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>gauche</span></a>'s approach in particular, which is to implement records within a <a href="https://functional.cafe/tags/clos" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>clos</span></a>-like object system, which seems to allow you to work with generic methods on record-types (which is something that GOOPs is not very good at, for example). what approach did you go with for your record system?</p>
blake shaw 🇵🇸<p>Good talk about <a href="https://functional.cafe/tags/Kandria" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Kandria</span></a>, the platformer developed in Common <a href="https://functional.cafe/tags/Lisp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Lisp</span></a> using <a href="https://functional.cafe/tags/CLOS" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CLOS</span></a>, as well as <a href="https://functional.cafe/tags/Alloy" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Alloy</span></a>, the <a href="https://functional.cafe/tags/UI" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>UI</span></a> protocol toolkit used to develop it, from Tuesday at <a href="https://functional.cafe/tags/ELSconf" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ELSconf</span></a></p><p><a href="https://www.twitch.tv/videos/1803073686" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://www.</span><span class="">twitch.tv/videos/1803073686</span><span class="invisible"></span></a><br>(starts at approx. 1hr into the stream)</p>
LisPi<p><span class="h-card"><a href="https://astolfo.social/@natty" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>natty</span></a></span> Because it's completely unnecessary in proper <a href="https://mastodon.top/tags/Object" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Object</span></a> systems like <a href="https://mastodon.top/tags/CLOS" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CLOS</span></a>.</p><p>That is to say, <a href="https://mastodon.top/tags/multimethod" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>multimethod</span></a> / <a href="https://mastodon.top/tags/GenericFunction" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>GenericFunction</span></a> based object systems.</p>
Panicz Maciej Godek<p>Having programmed in Kawa for over a year now, and having programmed in Guile for some time before, I have some thoughts regarding <a href="https://functional.cafe/tags/Java" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Java</span></a> vs Common <a href="https://functional.cafe/tags/Lisp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Lisp</span></a>.</p><p>I haven't used Java all that much, and Common Lisp even less, but I think that Guile's <a href="https://functional.cafe/tags/GOOPS" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>GOOPS</span></a> system is similar to <a href="https://functional.cafe/tags/CLOS" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CLOS</span></a> - and likewise, the OO system in Kawa literally is that of Java.</p><p>I remember the time when I was making set of GUI widgets for my humanoid robot pose editor. I was using GOOPS for that, and I feel that it was a total mess. Well, it did work, but I don't want to go back to that code.</p><p>I was using GOOPS in many other ways, for example - to overload various math operations for matrices and quaternions. The code I wrote back then can still be admired, say, here:</p><p><a href="https://github.com/panicz/slayer/blob/master/guile-modules/extra/math.scm" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/panicz/slayer/blob/</span><span class="invisible">master/guile-modules/extra/math.scm</span></a></p><p>I think it was today that I got enlightened on what I really didn't like about the GOOPS/CLOS approach with generic and multimethods. It may seem like extremely flexible system, but I think that multimethods combined with subclasses are a terrible idea in practice.</p><p>Suppose that we have a base class &lt;A&gt;</p><p>(define-class &lt;A&gt; ())<br>(define a (make &lt;A&gt;))</p><p>and its two subclasses:</p><p>(define-class &lt;B&gt; (&lt;A&gt;))<br>(define b (make &lt;B&gt;))</p><p>(define-class &lt;C&gt; (&lt;A&gt;))<br>(define c (make &lt;C&gt;))</p><p>Now, suppose that I also have a generic method:</p><p>(define-method (m (x &lt;A&gt;) (y &lt;A&gt;)) 'aa)</p><p>and its two specializations</p><p>(define-method (m (x &lt;B&gt;) (y &lt;A&gt;)) 'ba)</p><p>(define-method (m (x &lt;A&gt;) (y &lt;C&gt;)) 'ac)</p><p>Now, what is going to happen when I invoke</p><p>(m b c)</p><p>?</p><p>I checked it with Guile, and it chose the 'ba implementation. I don't know if that's because it was defined earlier, or because the method specialization is defined to be resolved from left to right - and frankly, I don't care.</p><p>Imagine that one programmer wrote the 'ac implementation and had some working code. Now, if another programmer comes and defines the 'ba variant, they would break the existing code. And this is the fundamental problem.</p>