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

Re: various comments

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

Jussi Piitulainen <jpiitula@xxxxxxxxxxxxxxxx> writes:

> S.H.M.J. Houben wrote on Mon, 2001 Nov 12:

[ ... ]

> > Interesting proposal.
> > 2. I don't think array-dimensions is a good name. I would [...]
> >    what about calling it array-number-of-dimensions ?
> Too unwieldy. I'd rather call it haulong. What about array-dim? Or
> array-rank again, though somebody used to oppose that (because matrix
> rank is something else altogether).

"Array-dimensionality" ?  I still prefer array-rank, not believing that
many will confound it with matrix rank.  "Rank" is used to specify
the number of dimensions of a tensor, without any confusion.

> > 3. I don't like the shape format. It is logically a list of pairs:

[ ... ]

> Also, (shape 0 4 0 4) does not get more complicated when an individual
> index expression gets more complicated. List structure would really
> favour constant bounds. Compare
>     (shape b (* 2 e) b (+ e 1))
>     (list (list b (* 2 e)) (list b (+ e 1)))

One would typically write `((,b ,(* 2 e)) (,b ,(+ e 1))) which is
only a little less perspicuous than the (shape ...) example.

> and also notice that the very word "shape" there communicates intent
> to the reader, while "list" does not.

"Shape" is a very generic sort of word, likely to be used in other
contexts -- did you consider "array-shape" ?

> > 4. Apparently arrays are supposed to be disjoint from vectors.
> >    This could be made more explicit. Also, this means that even
> >    1-dimensional 0-based arrays are disjoint from vectors?
> Hm. Maybe that should be more explicit. Yes, I think they are best
> disjoint. Array-ref and friends might be able to access vectors
> transparently, with runtime cost, but I would not want to ask
> implementors to make vector-ref and friends able to access certain
> kinds of multidimensional arrays. They might just refuse.

Nevertheless, using the array functions with vector arguments can
be very convenient, could disjointness from vectors (and even strings)
be left unspecified?