From: "trans. (T. Onoma)" Date: 2004-10-08T11:08:54+09:00 Subject: Re: Range behavior (Re: [RCR] New [] Semantics) On Thursday 07 October 2004 08:08 pm, Yukihiro Matsumoto wrote: | Define the problem to solve. What do you want to fix? | | Ranges serving both continuous and discrete? Or "member?" and | "include?" behaving differently? Or having fun with designing | ranges? Or something else? Well, it might look like the later, b/c I am also "exploring". But also b/c it would be nice to solve as many outstanding issues at once rather then just one at the time --b/c one might effect the another, and you would end up changing them again later (or be learn to live with problems). | For your note, I refuse to separate continuous ranges and discrete | ranges. In Ruby, I'd rather choose classes to have multiple purpose. | For example, arrays can be served as stack, queue, etc. I feel same | to ranges too. | | I thought "member?" (which means item is included in the member set of | enumeration) and "include?" (which means item is included between | upper and lower bound) can be easily distinguished. | | I have several ideas, but I have to know what is the problem first. Okay. In summary the problem centers around how to to define #===. When you think about that you realize Range is serving two purposes which are not perfectly compatible: 1) a discrete iterative set where .succ on first is used as generator and membership is defined like val <=> succ first >/>= 0 && val <=> last