Re: SRFI 231 and empty arrays
Bradley J Lucier 01 Apr 2026 22:20 UTC
OK, we’re agreed that
an empty literal array constant with upper bounds ‘#(2 0) and lower bounds ‘#(0 0) (a “tall narrow” empty array) *can* be represented in this notation
and
an empty literal array constant with upper bounds ‘#(0 2) and lower bounds ‘#(0 0) (a “short wide” empty array) *cannot* be represented in this notation.
So my question is:
Do you want SRFI 268 notation to be able to specify all literal array constants?
If so, then something different from CL notation would seem to be needed.
Brad
> On Apr 1, 2026, at 5:47 PM, John Cowan <xxxxxx@ccil.org> wrote:
>
> ---- External Email: Use caution with attachments, links, or sharing data ----
>
>
> Update: The CL description of #A says "If some dimension of the array
> whose representation is being parsed is found to be 0, all dimensions
> to the right (i.e., the higher numbered dimensions) are also
> considered to be 0."
>
>
> On Wed, Apr 1, 2026 at 5:30 PM John Cowan <xxxxxx@ccil.org> wrote:
>>
>> CL (where all lower bounds are 0) doesn't round-trip empty arrays
>> either. Arrays with dimensions (0 0) and (0 2) both print as #2A(),
>> which is read back with dimensions (0 0). However, an array with
>> dimensions (2 0) prints as #2A(() ())
>>
>> The element type is also discarded on output: if you read them in, you
>> always get an array with the generic storage class. SBCL has an
>> extension for this.
>>
>> On Wed, Apr 1, 2026 at 1:50 PM Bradley J Lucier <xxxxxx@purdue.edu> wrote:
>>>
>>> On Mar 31, 2026, at 12:08 PM, Bradley J Lucier <xxxxxx@purdue.edu> wrote:
>>>
>>> In your notation, how would you specify an empty array literal with lower bounds ‘#(0 0) and upper bounds ‘#(0 2)?
>>>
>>>
>>> After more study, I’ll say that I don’t think one can specify an empty array literal with lower bounds ‘#(0 0) and upper bounds ‘#(0 2) using SRFI 268.
>>>
>>> Brad