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

Juan Vuletich juan at jvuletich.org
Wed May 6 08:13:28 PDT 2020


On 5/2/2020 1:00 PM, Hernan Wilkinson via Cuis-dev wrote:
> Hi,
>  a fix for Interval>>#includes: is already in github.

Nice.

>  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?

Yes, please! (No, I'm not Nahuel, but still, yes please!)

> Cheers!
> Hernan.
>
> On Fri, May 1, 2020 at 9:05 PM Hernan Wilkinson 
> <hernan.wilkinson at 10pines.com <mailto: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 <mailto: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 <mailto:Cuis-dev at lists.cuis.st>
>         https://lists.cuis.st/mailman/listinfo/cuis-dev
>
>
>
>     -- 
>     *Hernán Wilkinson
>     Agile 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 Wilkinson
> Agile 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

Cheers,

-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20200506/5b2124d5/attachment-0001.htm>


More information about the Cuis-dev mailing list