Al Major wrote: > Claudio and JB. You both raised similar arguments about why the empty > interval is basically the same whether it is [9:00, 9:00) or [10:00, > 10:00), i.e. the important factor is that it's empty, not what it's > end-point is.
Stop right there: empty intervals do not have end points. In analysis, the interval [a, a) is the same as (a, a) is the same as (2, 1): they are all empty. (I don't want to say 'zero-length', because in analysis it's possible to have non-empty intervals of 'length' zero, which I don't fully understand. The good news is that not many users of joda-time will be trying to construct the time-line equivalent of Cantor's set, so we don't necessarily have to worry about that.) > if you look at the interval [9:00, 9:00) as the limit of [9:00, 9:00 + > epsilon) as epsilon goes to zero, you have a situation where each of the > intervals on the way to the limit (i.e. epsilon > 0) overlaps [9:00, > 10:00) and is _not_ contained in [10:00, 11:00). i'm arguing that the > limit [9, 9) should be interpreted in a way that is consistent with the > behavior of the sequence that defines it [9, 9 + e). this is what i mean > by _intuitive_ behavior. i.e. [9:00, 9:00) overlaps [9:00, 10:00) and is > not contained in [10:00, 11:00). Nothing says the limit of a sequence of intervals has to overlap any element of that sequence. That's the difference (if I remember correctly) between a compact set and not-a-compact set. Compactness is useful, because it guarantees that the limit point of a sequence in that compact set is in that set, but otherwise it's not essential. > in any case, my proposed solution involves allowing both open and closed > intervals. which results in a more complete and consistent set-theoretic > framework for intervals. which it sounds like JB, at least, may favor. > > and as i said earlier, i already have a use case for closed intervals, > so there's at least one person that needs them. i don't have one for > open intervals yet, but i suspect there are valid use cases out there. Half-open intervals are fine, as long as they are not empty. The same is true of any interval, open or closed. BTW, this is oddly fun. It's the most I've talked about topology in years. -- J. B. (Joe) Rainsberger :: http://www.jbrains.info Your guide to software craftsmanship JUnit Recipes: Practical Methods for Programmer Testing 2005 Gordon Pask Award for contribution Agile Software Practice Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Joda-interest mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/joda-interest
