Hei,

I have a piece of code that ECL seems to stumble upon. It's been awhile since I fineread CLHS,
but it is my understanding that the code in question is ok according to the standard.  The code:

$ cat ecl-issue.lisp
(defstruct rstk
  (make-element #'identity :read-only t))

(defstruct (pq (:include rstk (make-element #'car))))


When using COMPILE-FILE on the the file in ECL it claims to be unable to expand the DEFSTRUCT
macro for the struct PQ. If the :read-only keyword is removed things compile fine.


When I read the CLHS wrt :read-only it says:
:read-only x
When x is true, this specifies that this slot cannot be altered; it will always contain the value supplied at construction time. setf will not accept the reader function for this slot. If x is false, this slot-option has no effect. X is not evaluated.

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.

Is this an issue with ECL or is there something I am missing?

(Tested with ECL built with gcc 4.0 on OSX 10.5)

Cheers,
Stig