Hi Bo,

Compare:

Example #1:
a: [1 2]
remove back tail a
b: skip a 2
index? b

== 2

Example #2:
a: [1 2]
b: skip a 2
remove back tail a
index? b

** Script Error: Out of range or past end.
** Where: index? b

>From that I am concluding, That Rebol behaviour is inconsistent, because
both cases should yield the same result. My suggestion is as follows:

old-index?: :index?
index?: function [
    {Returns the index number of the current position in the series.}
    series [series! port!]
] [result] [
    if error? result: try [old-index? :series] [result: old-index? series:
tail :series]
    result
]

Now the result of Example#2:

== 2

Andrew could enhance Rebol patches, I think.

Regards
    Ladislav

>
> Ladislav,
>
> Do you see this as being a bug?  If so, why?  Also, what behavior
> would you rather have occur?
>
> Awaiting your answer!
>
> REBOL Support
> --
>




Reply via email to