|
From: Todd S. <ts...@op...> - 2003-05-07 15:37:43
|
Pascal Bourguignon <pj...@in...> writes: > Christophe Rhodes writes: > > [ off-list to give you a chance to reflect. ] > > Thank you :-) > > > Pascal Bourguignon <pj...@in...> writes: > > > > > Christophe Rhodes writes: > > >> Pascal Bourguignon <pj...@in...> writes: > > >> > > >> > The point is that while a (ARRAY (ARRAY BASE-CHAR *) *) has to be > > >> > implemented as an (ARRAY T *), it must not forget that it contains > > >> > actually (ARRAY BASE-CHAR *). > > >> > > >> Yes it must. It is required to by the ANSI standard for the > > >> language. See the CLHS page for System Class ARRAY: > > >> > > >> If element-type is the symbol *, arrays are not excluded on the > > >> basis of their element type. Otherwise, only those arrays are > > >> included whose actual array element type is the result of upgrading > > >> element-type; see Section 15.1.2.1 (Array Upgrading). > > > > > > Beware, I've always specified the type of the elements. I've only used > > > the * wildcard for the dimension. > > > > Perhaps you failed to read the second sentence of the quote? > > Yes. You're right. That's unfortunate. They link such a high level > expression as: (ARRAY (ARRAY BASE-CHAR *) *) to an implementation > detail such as UPGRADED-ARRAY-ELEMENT-TYPE. This is without much > consequence until you treat type declarations as assertions. I'm not so sure. The CLHS page for Declaration TYPE has this to say: Within the lexical scope of an array type declaration, all references to array elements are assumed to satisfy the expressed array element type (as opposed to the upgraded array element type). A compiler can treat the code within the scope of the array type declaration as if each access of an array element were surrounded by an appropriate the form. The Examples section there reinforces this, except that it seems to invoke undefined behavior by storing 127 into an (array (signed-byte 5) 1) array. I think that's probably an errata, but maybe I'm missing something? -- Todd Sabin <ts...@op...> |