Hei,<br><br>I have a piece of code that ECL seems to stumble upon. It's been awhile since I fineread CLHS, <br>but it is my understanding that the code in question is ok according to the standard. The code:<br><br>$ cat ecl-issue.lisp<br>
(defstruct rstk<br> (make-element #'identity :read-only t))<br><br>(defstruct (pq (:include rstk (make-element #'car))))<br><br><br>When using COMPILE-FILE on the the file in ECL it claims to be unable to expand the DEFSTRUCT<br>
macro for the struct PQ. If the :read-only keyword is removed things compile fine.<br><br><br>When I read the CLHS wrt :read-only it says:<br><dl><dt><tt>:read-only </tt><i>x</i> </dt><dd>
When <i>x</i> is <a rel="DEFINITION" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/glo_t.html#true"><i>true</i></a>, this specifies that this slot cannot be altered; it will always contain the value supplied at construction time. <a rel="DEFINITION" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/mac_setfcm_psetf.html#setf"><b>setf</b></a> will not accept the <a rel="DEFINITION" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/glo_r.html#reader"><i>reader</i></a> function for this slot. If <i>x</i> is <a rel="DEFINITION" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/glo_f.html#false"><i>false</i></a>, this slot-option has no effect. <i>X</i> is not evaluated. </dd>
</dl><br>So if I call (MAKE-PQ), ie the construction. my understanding is that the slot initform should evaluate to #'CAR and that should be the initial value, and after this the calue cannot be changed. This also seems to correspond to other lisps.<br>
<br>Is this an issue with ECL or is there something I am missing?<br><br>(Tested with ECL built with gcc 4.0 on OSX 10.5)<br><br>Cheers,<br>Stig<br><br><br>