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

Re: octothorpe array syntax; other comments

This page is part of the web mail archives of SRFI 47 from before July 7th, 2015. The new archives for SRFI 47 contain all messages, not just those from before July 7th, 2015.

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.