Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT/FIX: Picking the right PICK #5

Merged
merged 2 commits into from
Jun 14, 2018
Merged

FEAT/FIX: Picking the right PICK #5

merged 2 commits into from
Jun 14, 2018

Conversation

Oldes
Copy link
Owner

@Oldes Oldes commented Jun 13, 2018

In Rebol2, picking value with index 0 was always returning null. In R3-alpha it was changed that zero index was working like index -1... more at this blog http://www.rebol.net/cgi-bin/r3blog.r?view=0173

I decided to revert this change and let it working as before (and so be compatible with Red too)

So now it works for example like:

>> pick tail "123" -1
== #"3"
>> pick tail "123" 0
== none

and it is also consistent with AT positioning:

>> at tail "123" -1
== "3"

Related issues:
metaeducation/rebol-issues#608
metaeducation/rebol-issues#609
metaeducation/rebol-issues#748
metaeducation/rebol-issues#857
metaeducation/rebol-issues#2117

and also:
metaeducation/rebol-issues#613

In Rebol2, picking value with index 0 was always returning null. In R3-alpha it was changed that zero index was working like index -1... more at this blog http://www.rebol.net/cgi-bin/r3blog.r?view=0173

I decided to revert this change and let it working as before (and so be compatible with Red too)

So now it works for example like:

>> pick tail "123" -1
== #"3"
>> pick tail "123" 0
== none

and it is also consistent with AT positioning:

>> at tail "123" -1
== "3"

Related issues:
metaeducation/rebol-issues#608
metaeducation/rebol-issues#609
metaeducation/rebol-issues#748
metaeducation/rebol-issues#857
metaeducation/rebol-issues#2117

and also:
metaeducation/rebol-issues#613
hostilefork added a commit to metaeducation/ren-c that referenced this pull request Jun 14, 2018
Consensus in general was that the negative indexing behavior of
R3-Alpha was not pleasing.  This restores the historical behavior.
Also makes it so that picking with DECIMAL! will round the decimal
down and use the INTEGER! value, vs. SELECT-ing the DECIMAL.

Commit initiated by Oldes in:

Oldes#5

His comments there:

"In Rebol2, picking value with index 0 was always returning null. In
R3-Alpha it was changed that zero index was working like index -1...
more at this blog http://www.rebol.net/cgi-bin/r3blog.r?view=0173"

"I decided to revert this change and let it working as before (and so
be compatible with Red too)"

"So now it works for example like:"

    >> pick tail "123" -1
    == #"3"
    >> pick tail "123" 0
    == none

"and it is also consistent with AT positioning:"

   >> at tail "123" -1
   == "3"

"Related issues:"

metaeducation/rebol-issues#608
metaeducation/rebol-issues#609
metaeducation/rebol-issues#748
metaeducation/rebol-issues#857
metaeducation/rebol-issues#2117

"and also:"

metaeducation/rebol-issues#613
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant