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

Re: Issue: ARRAY-TYPE-ELEMENT-TYPE-SEMANTICS (version 5)



Sorry that I was so terse. Call the proposal to make arrays remember their
element types REMEMBER-TYPE.

I had also proposed REMEMBER-TYPE at one time. 
This is certainly legal in current Common Lisp -- any implementation could
currently do this and conform to CLtL. However, none do. The weight of
current practice is a useful indication of the well-considered thoughts of
the designers of current implementations; in several areas, implementations
have chosen to diverge from CLtL, exactly because CLtL is "buggy". So, the
justifcation that "nobody does it" is that there is evidence that no Common
Lisp implementor so far has thought that it would be useful, consistent,
cleaner.

Secondly, there is no simple canonicalization for type specifiers.
Currently, I can reasonably expect that

(equal (array-element-type (make-array n :element-type '(integer -129
128))) 
   (array-element-type (make-array n :element-type '(signed-byte 8))))

yet your proposal to require that   (equal (array-element-type (make-array
n :element-type x))
            x)

    for all legal types x."


would violate that.

It was argued that array element types are an important part of the
underlying implementation, their visibility in a portable way is useful.

It was argued that REMEMBER-TYPE would add an additional storage burden
that would be a cumbersome implementation burden.

REMEMBER-TYPE would make the language  easier to document and understand
only if there were some reasonable way to handle the canonicalization of
types mentioned above.

I'm having trouble with the issues of "obscure bugs" and "increases
portability". Perhaps I'm too close to the subject, but could you supply
some examples of obscure bugs or non-portable programs which REMEMBER-TYPE
would address?