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

Make VECTOR! of same index-base as other series #748

Open
rebolbot opened this issue May 5, 2009 · 1 comment
Open

Make VECTOR! of same index-base as other series #748

rebolbot opened this issue May 5, 2009 · 1 comment

Comments

@rebolbot
Copy link
Collaborator

rebolbot commented May 5, 2009

Submitted by: Carl

VECTOR! should be 1-based like the other datatypes. That is, FIRST of vector should return first value.

We must avoid a series datatype that works differently than the others (create confusion and hidden errors.)

If we want a 0-based indexing, we can add new action functions for that.

CC - Data [ Version: alpha 50 Type: Wish Platform: All Category: n/a Reproduce: Always Fixed-in:alpha 51 ]

@rebolbot
Copy link
Collaborator Author

rebolbot commented May 5, 2009

Submitted by: BrianH

See #613 for those functions, #608 and #609 for related tickets.

Oldes added a commit to Oldes/Rebol3 that referenced this issue 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
hostilefork added a commit to metaeducation/ren-c that referenced this issue 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
Projects
None yet
Development

No branches or pull requests

1 participant