From: "trans. (T. Onoma)" Date: 2004-10-08T03:07:32+09:00 Subject: Re: Range behavior (Re: [RCR] New [] Semantics) On Thursday 07 October 2004 01:26 pm, Markus wrote: | On Thu, 2004-10-07 at 09:55, trans. (T. Onoma) wrote: | > On Thursday 07 October 2004 11:27 am, Markus wrote: | > | On Thu, 2004-10-07 at 07:11, trans. (T. Onoma) wrote: | > | > --only Numeric ranges can be Continuous. | > | | > | Not so. Time ranges, for example, can be Continuous, as could | > | Colour or FuzzyTruthValue or... | > | > True. Although I think one could argue, that the defining characteristic | > is a *capability* to functionally map to rational numbers. So in a sense | > they are numeric too, even if they don't use Numeric as a base class. Is | > that important? | | Well, there are continuous mathematical constructs that _don't_ map | to the rationals (e.g. the reals), so I think it's a bad definition. I | may someday want to implement something that can represent sqrt(2) | exactly... Sorry, I meant reals. | > So yes, you are right. We need to consider Intervals of variant objects. | > But how? | | By having an Interval class that uses duck typing on its | sentinels? Maybe I'm missing the problem (I'm busy trying to get my | roll-your-own-operators patch working and haven't been following this | thread as closely as I'd like to) but why is this considered a problem? Okay, yes. I just meant which methods apply? I guess #<=> is all we have. So if they are comparable they can form a continuous range. And membership is constitute on falling between the sentinels. | It seems to me that restricting them to a specific base class would | be the harder (and less useful) of the options. | | > | > Consider further how succ determines successive members --a Range is | > | > an indeterminate ordered set built by iteration. Oddly one defines a | > | > Range with a first and last argument, but iterations are supposed to | > | > be defined by a seed (first) and the number of successive iterations. | > | | > | Supposed by whom? You can just as easily define an iteration with | > | a termination test (e.g. iterating over the lines of a File). | > | > Okay, sure. My point was simply that you get no promises with a | > termination test. | | Start: first | Succ: next = (2+sqr(this))*(2+sqr(step)) | Test: this < last | | Here's a simple (albeit contrived) case with a termination test | where you can promise that it terminates, even without knowing how many | steps it takes. I knew you were going to say something like that! But I think you know what I mean ... just that you don't _always_ know -- and in fact a range might terminate with one seed but not another. But I don't think that's too important. We can go the "shoot yourself in the foot route". That's fine with me. It would be nice to offer a notation, though, for "keep your foot out of trouble" too. ;) (i.e. seed,steps) I'll have to finish later.... got to run. T.