REBOL3 tracker
  0.9.12 beta
Ticket #0000608 User: anonymous

Project:



Short URL: http://issue.cc/r3/608
rss
TypeBug Statustested Date9-Feb-2009 21:36
Versionalpha 33 Categoryn/a Submitted byBrianH
PlatformAll Severitymajor Priorityhigh

Summary PICK and POKE of strings have off-by-one error with indexes < 1.
Description PICK and POKE of string types skip the 0 index, and negative indexes are shifted accordingly. PICK and POKE of block types work correctly.
Example code
; PICK of blocks
>> b: skip [a b c] 2
== [c]
>> pick b 2
== none
>> pick b 1
== c
>> pick b 0
== b
>> pick b -1
== a

; PICK of strings
>> b: skip "abc" 2
== "c"
>> pick b 2
== none
>> pick b 1
== #"c"
>> pick b 0
== none  ; should be #"b"
>> pick b -1
== #"b"  ; should be #"a"

Assigned ton/a Fixed inalpha 55 Last Update28-May-2009 07:53


Comments
(0000415)
BrianH
9-Feb-2009 21:49

Note that this bug exists in R2, for blocks as well. This needs to be fixed - it's like picking and poking in Roman numerals.
(0000867)
Carl
28-May-2009 05:41

See also #857
(0000868)
BrianH
28-May-2009 06:20

See also #609 - the same bug for AT.

Date User Field Action Change
28-May-2009 07:53 BrianH Status Modified built => tested
28-May-2009 06:20 BrianH Comment : 0000868 Added -
28-May-2009 05:41 carl Comment : 0000867 Added -
28-May-2009 05:41 carl Fixedin Modified => alpha 55
28-May-2009 05:41 carl Status Modified reviewed => built
26-Feb-2009 02:54 BrianH Priority Modified normal => high
9-Feb-2009 21:49 BrianH Comment : 0000415 Added -
9-Feb-2009 21:36 BrianH Code Modified -
9-Feb-2009 21:36 BrianH Status Modified submitted => reviewed
9-Feb-2009 21:36 BrianH Ticket Added -