Re: MAKE-INSTANCE and STRUCTURE-CLASS

"Tim Bradshaw (as tfb at cley dot com)" <[email protected]> Mon, 6 Jul 2026 16:24:47 +0100
Newsgroups gmane.lisp.lispworks.general,gmane.lisp.cl-pro
Message-ID <[email protected]>
--Apple-Mail-BA3CB287-FA7C-45C0-A3BD-22F3EE0B0188
Content-Type: text/html;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html class=3D"apple-mail-supports-explicit-dark-mode"><head><meta http-equi=
v=3D"content-type" content=3D"text/html; charset=3Dutf-8"></head><body dir=3D=
"auto"><div dir=3D"ltr"></div><div dir=3D"ltr">... and it is 2062 and the le=
ngth of the standard text will no longer fit in a fixnum in several implemen=
tations. &nbsp;A recent abortive attempt was made to print it: there are str=
ong suspicions that this was an in fact mostly manipulation of the stock pri=
ces of paper companies.</div><div dir=3D"ltr"><br></div><div dir=3D"ltr">No i=
mplementation has made any attempt to conform since 2016: it is estimated th=
at the construction of a conforming implementation is still possible in the s=
ense that sufficient storage does exist.</div><div dir=3D"ltr"><br></div><di=
v dir=3D"ltr">Automated analysis reveals that the number of inconsistencies s=
till to be resolved has been growing faster than the size of the text for</d=
iv><div dir=3D"ltr">some years and will exceed its absolute size within a de=
cade.</div><div dir=3D"ltr"><br></div><div dir=3D"ltr">Three major economies=
 have collapsed as a direct result of resources spent on the standard.</div>=
<div dir=3D"ltr"><br><blockquote type=3D"cite">On 6 Jul 2026, at 15:59, Marc=
o Antoniotti &lt;[email protected]&gt; wrote:<br><br></blockquote><=
/div><blockquote type=3D"cite"><div dir=3D"ltr">=EF=BB=BF<div dir=3D"ltr"><d=
iv><div><div>Of course, of course.<br><br></div>And yet... why don't we have=
 a STRUCT-FIELDS and a STRUCT-CONSTRUCTORS? (Etc, etc etc)<br><br></div>My a=
nswer is "because they punted"&nbsp;=F0=9F=A5=B9<br><br></div><div>Cheers</d=
iv><div><br></div><div>Marco</div><div><br></div></div><br><div class=3D"gma=
il_quote gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Mon=
, Jul 6, 2026 at 4:56=E2=80=AFPM Tim Bradshaw &lt;<a href=3D"mailto:tfb@cley=
.com">[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote"=
 style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pa=
dding-left:1ex">On 6 Jul 2026, at 15:15, Marco Antoniotti &lt;<a href=3D"mai=
lto:[email protected]" target=3D"_blank">[email protected]=
</a>&gt; wrote:<br>
&gt; <br>
&gt; my question was about "how can you do this in the least gross way?"<br>=

<br>
To which my answer is 'the only non-gross way is to not do that: use constru=
ctor functions passed as arguments instead'.<br>
<br>
Obviously that is not what everyone wants to do.<br>
<br>
&gt; The question is "how"?<br>
<br>
Same answer.<br>
<br>
&gt; And the sub question is "why the standard writers punted on this?".&nbs=
p; Because, IMHO, they did.<br>
<br>
I don't know.&nbsp; I know why I would have.&nbsp; That's because any answer=
 I can think of leads you into a tangled mess.<br>
<br>
For instance here's an answer:<br>
<br>
'There should be a method on make-instance for structure-class which calls t=
he constructor for the class given.&nbsp; There is no initialization or rein=
itialization protocol, [or may be there is?]'.<br>
<br>
OK.&nbsp; My structure definition has six constructors: which should be call=
ed?&nbsp; My other structure definition has a strictly BOA constructor: how d=
oes this get mapped onto make-instance's signature, if at all?&nbsp; My othe=
r structure definition has no constructors: is this an error?<br>
<br>
Should defstruct be extended compatibly to specify which constructor is call=
ed, which can't be a strictly BOA constructor?&nbsp; What are the implemento=
rs going to say when we suggest that?<br>
<br>
And on and on and more and more complicated.&nbsp; And now it's 2007 and the=
 spec still hasn't been published.<br>
<br>
Or just don't.&nbsp; Just ship the spec as it is.<br>
<br>
And over here tfb is waving his hands and saying 'stop already, just pass in=
 a constructor function'.<br>
<br>
--tim</blockquote></div><div><br clear=3D"all"></div><br><span class=3D"gmai=
l_signature_prefix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature"=
><div dir=3D"ltr"><div><span style=3D"font-family:monospace">Marco Antoniott=
i, Professor, Director &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tel. +39 -=
 02 64 48 79 01<br>DISCo, University of Milan-Bicocca U14 2043&nbsp;&nbsp; <=
a href=3D"http://dcb.disco.unimib.it" target=3D"_blank">http://dcb.disco.uni=
mib.it</a><br>Viale Sarca 336<br>I-20126 Milan (MI) ITALY<br><br></span></di=
v><span style=3D"font-family:monospace">REGAINS: <a href=3D"https://regains.=
disco.unimib.it/" target=3D"_blank">https://regains.disco.unimib.it/</a><br>=
</span></div></div>
</div></blockquote></body></html>=

--Apple-Mail-BA3CB287-FA7C-45C0-A3BD-22F3EE0B0188--

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
[email protected]
http://www.lispworks.com/support/lisp-hug.html