Email list hosting service & mailing list manager

internals - some thoughts Per Bothner (03 Sep 2016 07:13 UTC)
Re: intervals - some thoughts Per Bothner (03 Sep 2016 15:50 UTC)
Re: intervals - some thoughts Bradley Lucier (07 Sep 2016 21:37 UTC)

Re: intervals - some thoughts Bradley Lucier 07 Sep 2016 21:37 UTC

Thank you for your comments, which I attempt to address below.

On 09/03/2016 03:13 AM, Per Bothner wrote:
> Why use the term "domain" in some places while you use "interval" in
> others?

I use the term "domain" from the terminology for functions $f\:A\to B$,
so $A$ is the domain of $f$ and $B$ contains the range of $f$.

If A is an array, then (array-domain A) is, strictly speaking, the
domain of the function (array-getter A).

The domains of arrays are intervals.

I have gone through the entire document to review each use of the words
"domain" and "interval" and I think I have improved the readability of
the document.  Arguments to functions are generally named "interval"
(even if that interval will later be used as the domain or an array),
except in one spot, where there are two arguments "new-domain" and
"new-domain->old-domain".  I thought the parallel structure there was
worth keeping "domain" in the name of the argument.

>
> I still think "shape" might bet preferable.  For example
> "array-shape" instead of "array-domian".

I prefer to stick with array-domain.  As I mentioned in a previous email
the word "shape" implies something that is translation invariant to me
(two rectangles would have the same shape even if one is a translate of
the other).

>
> Drop interval-lower-bounds->list and interval-upper-bounds->list.
>
> You can use vector-map many places where you use XXX->list.  E.g.
> (map >= (vector->list lower-bounds1) (vector->list lower-bounds2))
> should be
> (vector-map >= lower-bounds1 lower-bounds2)

I followed your advice and did this (even though vector-map is not
standard R[45]RS).

>
> Unless you require intervals to be a distinct type (which I would
> not recommend) then I think the interval? predicate is useless.

John Cowan recommended that arrays and intervals be distinct types, you
recommend not (at least for intervals).

I have decided to go with John's suggestion for now.  A nontrivial
amount of error checking goes into checking that the arguments to
make-interval are consistent, so I'd like to keep interval? as a fast
check on whether an object is an interval.  I find that often intervals
are constructed once and re-used many times.

>
> I would prefer keeping the traditional term "rank".  Thus
> interval-dimension should be interval-rank (or shape-rank).
> array-dimension should be array-rank.
> An array doesn't have "a dimension", it has "a number of
> dimensions".  But that is clumsy.  Hence "rank".

I'm coming from this as a mathematician who teaches sophomores that the
"rank" of a matrix is the dimension of the range of the matrix, which is
a very different thing as the term rank here.

And I think people *do* talk about "three-dimensional arrays" of data.

So, while I appreciate your comments, I will keep the current terminology.

Thanks again for your comments.

Brad