[Cuis-dev] [ChangeSet] Proposal: Interval>>isIncludedIn:

Hernan Wilkinson hernan.wilkinson at 10pines.com
Sat May 2 09:00:36 PDT 2020


Hi,
 a fix for Interval>>#includes: is already in github.

 Nahuel, I think we should rename #isIncludesIn: for #isRangeIncludedIn:,
what do you think?
 If you agree, could you send the change and tests with this new name?

Cheers!
Hernan.

On Fri, May 1, 2020 at 9:05 PM Hernan Wilkinson <
hernan.wilkinson at 10pines.com> wrote:

> I like this message... but intervals are tricky because they are not
> ranges really due to the step they can be created with using #by:
>
> For example, (1 to: 10) isIncludedIn: (1 to: 11 by: 2) will return true,
> but should it?
> We can define that the semantic of #isIncludedIn: does not take care of
> the step. That is fine with me (maybe we should look for a message name
> that would transmit that semantic better?)
>
> BTW, there already exist the message #includesAllOf: that would do the
> work you need but it goes over all the elements of the interval and
> therefore it is a bit slower than your implementation.
>
> On the other hand, Interval>>#includes: is not working properly. For
> example: (12 to: -1 by: -1) includes: 1 returns false.
> I'll take a look at that later.
>
> Juan, what do you think?
>
> Hernan.
>
>
> On Wed, Apr 29, 2020 at 11:25 PM Nahuel Garbezza via Cuis-dev <
> cuis-dev at lists.cuis.st> wrote:
>
>> Hi!
>>
>> I'd like to add this message in the Interval class, that will allow to
>> check if an interval is included in another. For dealing with source ranges
>> it will be useful.
>>
>> Attached is a changeset for the method implementation and another with
>> the tests for it
>>
>> Thanks,
>> Nahuel
>> --
>> Cuis-dev mailing list
>> Cuis-dev at lists.cuis.st
>> https://lists.cuis.st/mailman/listinfo/cuis-dev
>>
>
>
> --
>
> *Hernán WilkinsonAgile Software Development, Teaching & Coaching*
> *Phone: +54-011*-4893-2057
> *Twitter: @HernanWilkinson*
> *site: http://www.10Pines.com <http://www.10pines.com/>*
> Address: Alem 896, Floor 6, Buenos Aires, Argentina
>


-- 

*Hernán WilkinsonAgile Software Development, Teaching & Coaching*
*Phone: +54-011*-4893-2057
*Twitter: @HernanWilkinson*
*site: http://www.10Pines.com <http://www.10pines.com/>*
Address: Alem 896, Floor 6, Buenos Aires, Argentina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20200502/9c8d2bbe/attachment.htm>


More information about the Cuis-dev mailing list