Re: Structures as literals
Martin Simmons <[email protected]>
| Newsgroups | gmane.lisp.lispworks.general |
|---|---|
| Message-ID | <[email protected]> |
>>>>> On Mon, 2 Mar 2026 18:39:54 +0000, Tim Bradshaw said: > > I'm now trying to work out why the spec didn't just mandate that. I can see > why, for CLOS instances, it probably should not, but for structures > ... well, may be you could argue it was undesirable, but what LW does seems > a sensible fallback. The proposal the added make-load-form gave this rationale: "Only the programmer who designed a class can know the correct way to reconstruct objects of that class at load time, therefore the reconstruction should be controlled by a generic function." and: "The default for class objects and structures is to signal an error, rather than picking some particular object reconstruction technique, because no reconstruction technique is appropriate for all objects. It only takes two lines of code, as in example 4, to instruct the compiler to use the technique that most often has been suggested as the default." I think the code in LW predates CLtL2, where there was no specification of which types of objects can be dumped. -- Martin Simmons LispWorks Ltd http://www.lispworks.com/ _______________________________________________ Lisp Hug - the mailing list for LispWorks users [email protected] http://www.lispworks.com/support/lisp-hug.html