Re: A MOP minimisation question
"Pascal Bourguignon (as informatimago at gmail dot com)" <[email protected]>
| Newsgroups | gmane.lisp.lispworks.general |
|---|---|
| Message-ID | <[email protected]> |
This doesn’t prevent you to wrap your use of plists in functional abstractions to clearly define what you want to put in them. You can have both: some clean and stable data model, mixed with some experimental and one-shot “slots”. -- __Pascal Bourguignon__ Le 11 mars 2026 à 14:30, Marco Antoniotti <[email protected]> a écrit : On Wed, Mar 11, 2026 at 2:25 PM Pascal Bourguignon (as informatimago at gmail dot com) <[email protected] > wrote: 1- using symbol-plist (get and (setf get) are perfectly good options. They seem deprecated because there are more sophisticated mechanisms provided nowadays in Common Lisp, but this old mechanism is simple, efficient, cheap, and works well (thanks to packages to avoid name collisions in keys). I ranted about this 😏 but I did forget p-lists. https://within-parens.blogspot.com/2024/03/a-rant-about-r-and-python-and-anything.html Cheers MA On 11 Mar 2026, at 12:05, Tim Bradshaw (as tfb at cley dot com) <[email protected] > wrote: As I mentioned in other messages a while ago, I wrote a trivial/special-purpose thing which does a limited version of SoA. I'm now slowly writing a more general one which is inevitably suffering from serious second-system syndrome. One of the things it needs to do is maintain information at the class level: things like the layout of the arrays and how slots map onto them, and so on. Now bear in mind that once, long ago, I was fairly knowledgeable about the AMOP MOP, but for at least a decade I've barely used CLOS at all (I think I've had the classic 'object systems aren't all that' moment). What I do now is to have a metaclass which has some extra slots and so on. But an earlier version didn't do that: it just stored the class-level data in properties on the class name. If we assume that classes always have names (which is a restriction I am more than happy with) is there really *any* good reason not to do this and thus rely less on MOP features (I still need some small ones). Performance is not a good reason: these things are never used when that matters since their entire purpose is to enable the system to compile things away. I realise this is an ideological question: assume I would rather minimise my code's exposure to the MOP even if using it is The Right Thing. --tim _______________________________________________ Lisp Hug - the mailing list for LispWorks users [email protected] http://www.lispworks.com/support/lisp-hug.html -- Marco Antoniotti, Professor, Director tel. +39 - 02 64 48 79 01 DISCo, University of Milan-Bicocca U14 2043 http://dcb.disco.unimib.it Viale Sarca 336 I-20126 Milan (MI) ITALY REGAINS: https://regains.disco.unimib.it/