[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issue: ARRAY-TYPE-ELEMENT-TYPE-SEMANTICS



Either I oppose both options or an additional proposal is needed.  The
problem is that I want the following code to "work".

(DEFVAR MY-ARRAY (MAKE-ARRAY 20 :ELEMENT-TYPE '(SIGNED-BYTE 5)))
;;; Upgrade the storage of the above any way you want

...

(LET ((MY-ARRAY MY-ARRAY))
  (DECLARE (TYPE (ARRAY (SIGNED-BYTE 5)) MY-ARRAY))
  (SETF (AREF MY-ARRAY 10) 127))    ; This is an error.  In fact it
                                    ; signals an error with the right
				    ; optimization flags.

The SETF obviously conflicts with the local declaration and there is
no reason that even a fairly dumb compiler can't give an error without
reference to the type information that is associated with the global
definition of MY-ARRAY.

I don't think that this is covered by either "for declaration" or "for
discrimination" of the array.  It is a local declaration covering
references to elements of the array; unfortunately our current
declaration terminology doesn't handle this distinction.