From: Duncan Harvey
Subject: Array upgrading, characters and strings
Date: 
Message-ID: <1evz7xt.166lfdz136jkweN%spam@hubris2.demon.co.uk>
Is a conforming implementation permitted to do this:
  > (upgraded-array-element-type 'character)
  EXTENDED-CHAR

given the following[1]?

  From 15.1.2.1 Array Upgrading:
    The upgraded array element type of a type T1 is a type T2 that is a
    supertype of T1 and that is used instead of T1 whenever T1 is used
    as an array element type for object creation or type discrimination.
    [...]
    Type upgrading implies a movement upwards in the type hierarchy
    lattice. A type is always a subtype of its upgraded array element
    type. 

  From 15.2 The Arrays Dictionary:
    UPGRADED-ARRAY-ELEMENT-TYPE
      [...]
      If typespec is character, the result is type equivalent to
      character.  [...]

  From the glossary:
    type equivalent adj. (of two types X and Y) having the same
    elements; that is, X is a subtype of Y and Y is a subtype of X. 

    subtype n. a type whose membership is the same as or a proper subset
    of the membership of another type, called a supertype. (Every type
    is a subtype of itself.)

  And from 13.2 The Characters Dictionary:
    EXTENDED-CHAR 
      [...]
      The type extended-char is equivalent to the type
      (and character (not base-char)).

[1] Yes, yes, from the HyperSpec, not the ANS proper.
-- 
Duncan Harvey
"Smiling and waving. Before letting himself fall."
                       -- Anja Garbarek, The Diver
From: Barry Margolin
Subject: Re: Array upgrading, characters and strings
Date: 
Message-ID: <EDl07.23$ed1.158@burlma1-snr2>
In article <····························@hubris2.demon.co.uk>,
Duncan Harvey <······@hubris2.demon.co.uk> wrote:
>Is a conforming implementation permitted to do this:
>  > (upgraded-array-element-type 'character)
>  EXTENDED-CHAR

No.  EXTENDED-CHAR is a proper subset of CHARACTER, so upgrading can never
produce this.  Like it says, "upgrading implies a movement upwards", but
this would be a downward movement.  EXTENDED-CHAR and BASE-CHAR partition
the CHARACTER type; such an array would not be able to hold any BASE-CHAR
characters.

-- 
Barry Margolin, ······@genuity.net
Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.