|
empty intervals
Per Bothner
(29 Jul 2015 16:44 UTC)
|
|
Re: empty intervals
John Cowan
(29 Jul 2015 17:12 UTC)
|
|
Re: empty intervals
John Cowan
(29 Jul 2015 17:16 UTC)
|
|
Re: empty intervals
Bradley Lucier
(29 Jul 2015 20:21 UTC)
|
|
Re: empty intervals Per Bothner (29 Jul 2015 20:56 UTC)
|
|
Re: empty intervals
Bradley Lucier
(29 Jul 2015 22:02 UTC)
|
|
Re: empty intervals
Per Bothner
(29 Jul 2015 23:36 UTC)
|
|
Re: empty intervals
John Cowan
(01 Aug 2015 03:52 UTC)
|
|
Re: empty intervals
Bradley Lucier
(01 Aug 2015 03:57 UTC)
|
|
Re: empty intervals
Bradley Lucier
(31 Jul 2015 20:49 UTC)
|
|
Re: empty intervals
Per Bothner
(31 Jul 2015 22:14 UTC)
|
|
Re: empty intervals
John Cowan
(31 Jul 2015 23:57 UTC)
|
|
Re: empty intervals
John Cowan
(31 Jul 2015 23:37 UTC)
|
|
Re: empty intervals
Bradley Lucier
(01 Aug 2015 02:00 UTC)
|
|
Re: empty intervals
John Cowan
(29 Jul 2015 21:11 UTC)
|
|
Re: empty intervals
Bradley Lucier
(29 Jul 2015 22:27 UTC)
|
|
Re: empty intervals
John Cowan
(01 Aug 2015 04:20 UTC)
|
On 07/29/2015 01:21 PM, Bradley Lucier wrote:
> Is (interval ‘#(1) ‘#(0)) allowed?
I see no particular reason to allow it. It's similar to
(substring "abcde" 3 10)
You could say that this is the subset of "abcde" whouse indexes i
satisfy (and (>= i 3) (< i 10)). However, we treat that as an error.
A plausible extension would be:
(substring string interval)
which would be equivalent to:
(substring string (interval-lower-bound interval 0)
(interval-upper-bound interval 0))
assuming (interval-dimension interval) is 1 (and an error if it is not).
I'm not saying we should do this; however, we might keep in mind that in
some implementations (such as Kawa) a vector of length N is also an
array such that (array-domain VEC) is (interval #(0) #(N)).
> It’s also empty (in the sense
> that no multi-indices satisfy 1<= i<0); is it equal to (interval
> ‘#(1) ‘#(1))? Or (interval ‘#(2) ‘#(0))? Or (interval '#(1 1) ‘#(0
> 0))? Or is (interval ‘#(0) ‘#(0)) a subset of (interval ‘#(1)
> ‘#(2))? (In set theory, the answer is yes.)
>
> Is an empty set of one-indices "the same” (in whatever sense) as an
> empty set of two-indices?
No. (interval ‘#(0) ‘#(0)) is different from (interval ‘#(1) ‘#(1)).
It may not matter, for most uses.
> (In set theory, yes. In some other theories, I don’t know.)
APL-derived languages talk about "array theory" - which is different
from set theory. Of course different APL-derived languages have
different variations of array theory - and their support for
general lower bounds varies.
> I understand that the base case of no multiplicands gives one as an
> answer, because it’s useful. (That’s the same reason that $0^0=1$,
> that it’s a useful convention.)
>
> Perhaps if I understood the use of such things. We already have
> scalars, why do we need zero-dimensional arrays?
In APL languages, a scalar is the same as 0-rank array. In Scheme,
I'd say a zero-dimensional array is the same as a box, in the SRFI-111 sense.
> Or arrays that
> can’t return any values, because their underlying domains are empty?
Why do we need vectors or lists or strings that can't return any values,
because their underlying domains are empty?
--
--Per Bothner
xxxxxx@bothner.com http://per.bothner.com/