Re: MOP question for language lawyers: can you specialize on standard-class
"Tim Bradshaw (as tfb at cley dot com)" <[email protected]> Sat, 16 May 2026 21:04:24 +0100
| Newsgroups | gmane.lisp.lispworks.general |
|---|---|
| Message-ID | <[email protected]> |
On 16 May 2026, at 14:20, Pascal Costanza <[email protected]> wrote: > It just happens to be the case that I recently implemented a library for sparse matrix operations in Common Lisp and Julia, kind of in parallel with each other, and the existence of change-class in Common Lisp made that version significantly simpler. (In that library, a sparse matrix can be represented as a tree of operations or in materialized form, and the machinery for materializing the operations uses change-class to move it from one representation to the other. In other languages, you have to use double indirection instead, which infects the whole code base. The Common Lisp version is much more elegant because of change-class.) I have also written programs that made use of it. Bur I've come to the view that (eq a b) but not (equal (type-of a) (type-of b)) is an abomination: if two objects are the same object their types should be the same type. I think a much more serious problem with CLOS is the 'we made it so you can never really optimize anything' thing, especially if you take the AMOP MOP seriously. That is fixable I think (I'm slowly writing some ideas on how it might be fixed). People will argue that 'oh, you just use CLOS for the bits that don't need to be fast' like you know which those bits are when you start writing the program. Or 'when the time comes you redo it all with structures' so you can't use most of the interesting bits of CLOS in the first place and why not just start with structures then? And finally 'it doesn't need to be fast nowadays, look at Python' which is successful largely because it's a good, single-implementation wrapper around C or Fortran libraries for instance in the form of NumPy and serves as a scripting language for them. All my opinion of course. --tim _______________________________________________ Lisp Hug - the mailing list for LispWorks users [email protected] http://www.lispworks.com/support/lisp-hug.html