Skip to content

Proposal: slice and between become half-open by default, changeable via optional argument #869

Closed

Description

@mlucy

We change slice and between to be open on the end of their range by default, and add the optional arguments left_bound and right_bound which can be either open or closed:

> r([1, 2, 3]).slice(0, 2)
[1, 2]
> r([1, 2, 3]).slice(0, 2, :right_bound => :closed)
[1, 2, 3]
> r([1, 2, 3]).slice(0, 2, :left_bound => :open)
[2]
# Same for between

We would also change the Ruby driver to make .. use the closed right bound and ... use the open right bound.

Activity

  1. mlucy commented on Jun 6, 2013

    @mlucy
    MemberAuthor

    Update: I think we should change delete_at to be half-open as well when we do this.

  2. jdoliner commented on Jun 6, 2013

    @jdoliner
    Contributor

    This is how python works.

    On Thu, Jun 6, 2013 at 10:16 AM, Michael Lucy [email protected]:

    Update: I think we should change delete_at to be half-open as well when
    we do this.

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/869#issuecomment-19060106
    .

  3. mlucy commented on Jun 21, 2013

    @mlucy
    MemberAuthor

    Alright, this seems settled with very little disagreement.

  4. ghost assigned on Jul 2, 2013
  5. ghost assigned on Jul 2, 2013
  6. mlucy commented on Jul 9, 2013

    @mlucy
    MemberAuthor

    I've started work on this.

  7. mlucy commented on Jul 17, 2013

    @mlucy
    MemberAuthor

    This is in review 743 by @Tryneus .

  8. mlucy commented on Jul 19, 2013

    @mlucy
    MemberAuthor

    This is in next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions