Re: octothorpe array syntax; other comments bear 12 Nov 2003 04:43 UTC

On Tue, 11 Nov 2003, Taylor Campbell wrote:

>I am vehemently opposed to any sort of octothorpe reader syntax for
>arrays; I have a preference for SRFI 10.  Indeed, SRFI 4's various new
>octothorpe reader macros caused much of the motivation behind SRFI 10.
>I instead propose that various SRFI 10 octothorpe-comma constructors
>be defined, perhaps as #,(array {vector,ac64,...} [rank]), or perhaps
>as #,({vector,ac64,...} [rank]); either way, I'd _much_ prefer SRFI 10
>constructors to new #Afoo stuff.

I think I agree that we shouldn't need new octothorpe constructs
for arrays:  In fact, the vectors-of-vectors-of-vectors... syntax
should work just fine for them:

#( #( a0 a1 a2)
   #( b0 b1 b2)
   #( c0 c1 c2))

should work fine for a 2-dimensional array. And if you think it
really has to store type information and/or be disjoint from
one-dimensional vectors, I'd agree with Mr. Campbell that

#,((array-of <type-expr>)
  #( #( a0 a1 a2)
     #( b0 b1 b2)
     #( c0 c1 c2)))

 or if untyped,

  #( #( a0 a1 a2)
     #( b0 b1 b2)
     #( c0 c1 c2)))

Is a better notation -- more general and extensible, and
requires less special reader support.  No need to mention
rank and size; those are implicitly given by the structure.