<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 8, 2020 at 4:17 PM Svante Carl v. Erichsen <<a href="mailto:svante.v.erichsen@web.de">svante.v.erichsen@web.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi!<br>
<br>
It is used all the time while working on a live system (image).<br>
<br>
If you want raw performance, you can often substitute structs, if you<br>
can live with the downsides: all objects from a class must be thrown<br>
away on redefinition (which might be OK if you want to treat e. g. a<br>
production system as unchangeable except through re-deployment), you<br>
only get single inheritance (which is often not needed anyway), and most<br>
of the MOP goodness is gone, starting with that you can't have a<br>
different metaclass than structure-class.  Also, because of the<br>
mentioned inflexibility, you have to dismiss several warnings if you do<br>
re-define a struct.<br>
<br>
On the other hand, structs have a lot of other, more low-level<br>
convenience tooling, e. g. automatic and portable serialization and<br>
deserialization.<br>
<br>
I _think_ that one might be able to create a new macro (let's say<br>
def-struct-class) that has exactly the same semantics as defstruct, but<br>
in development mode uses defclass underneath, while being an alias for<br>
defstruct in production mode.  It might get a bit hairy to adhere to<br>
:type :list or :vector, though.  The result is a bit limited, but just<br>
might be what you need.<br></blockquote><div><br></div><div>Yep. Got that.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
The folk at ITA also did quite some work on compile-time metaprogramming<br>
in order to get fast objects etc., so maybe they can chime in.<br></blockquote><div><br></div><div>This tells me that ITA had a pretty big itch to scratch in that area. Very interesting clue... <br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Anyway, my stance is that the incredibly flexible MOP classes provide<br>
general semantic usefulness, but Common Lisp does offer more constrained<br>
options that trade general usefulness for speed.<br></blockquote><div><br></div><div>I agree with one caveat, in this area ANSI-CL pretty gratuitously went one notch too far I'd say.</div><div><br> </div><div>Regards,</div><div><br></div><div>Jean-Claude</div><div><br></div></div></div>