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

Re: #\a octothorpe syntax vs SRFI 10



bear wrote:
> The dope-vectored syntax can handle both of these cases.
> We can write
> 
> #A <val> for a zero-dimensional array, just as the
>          current proposal recommends, and
> #0*3*2A() for a rank-3 array with one zero dimension.
> 
> Honestly, I'm not really sure how important it is to get these cases
> right, although together they're a powerful argument for the
> dope-vectored syntax.
> 
> My question is, how useful are such things as static arrays?

Yeah, I'm not sure about that either. I've never encountered a zero-rank
array before, and I've never seen an array with zero "columns," only
zero "rows" at the outermost dimension. (Except for Common Lisp, I don't
think I've ever used a language that even allows them, and I didn't know
CL could do it until today.)

I suggested the shape-specified array mainly because it's consistent
with the CL & PLT vector notation and because I find it easier to read
than rank-specified arrays. For "normal" arrays, the shape is often
redundant, but I think it's closer to "good" redundancy than "bad." The
fact that it allows proper specification of 0-by-N arrays is more of a
nitpicky detail (albeit one that satisfies my obsessive-compulsive
tendencies).

Properly specifying the shape is more important for arrays that can grow
or otherwise vary in size. That's not something that immutable arrays
can do, although it becomes important if you use them to seed mutable
arrays via copying. Not a big deal, but I'd rather do it right than to
aim for CL compatibility. (I'm surprised that CL didn't do it the
"right" way in the first place.)
-- 
Bradd W. Szonye
http://www.szonye.com/bradd