On 3/24/2022 2:51 AM, James Van Buskirk wrote:
> So
>
> char([integer::Z'48',Z'65',Z'6C',Z'6C',Z'6F',Z'2C',Z'20',Z'77',Z'6F',Z'72',Z'6C',Z'64'])
>
> but not
>
> [character::Z'48',Z'65',Z'6C',Z'6C',Z'6F',Z'2C',Z'20',Z'77',Z'6F',Z'72',Z'6C',Z'64']
>
> ?
> And still no
> char(Z'21') !?
Correct. Note that the definition of the CHAR intrinsic is NOT "transfer
the bit pattern" but "a value in the range 0 ≤ I ≤ n−1, where n is the
number of characters in the collating sequence associated with the
specified kind type parameter" It's not much of a hardship to write
char(int(Z'21')) or use your first form of an array constructor.
I'd also wonder how an attempt to shoehorn BOZ constants into CHAR would
deal with character sets that have varying number of bytes (UNICODE, etc.)
You are welcome to make a proposal to enhance the use of BOZ constants
in character contexts -
https://github.com/j3-fortran/fortran_proposals
is a good place for that.