REBOL3 tracker
  0.9.12 beta
Ticket #0000490 User: anonymous

Project:



rss
TypeBug Statustested Date19-Jun-2008 09:29
Versionalpha 29 Categoryn/a Submitted byJerry
PlatformAll Severitymajor Priorityhigh

Summary A Serious Bug in CHANGE/PART
Description >> data: "C# Rules"
>> change/part data "REBOL" 2
>> data
== "REBOLles"
Example code

			

Assigned ton/a Fixed inalpha 36 Last Update26-Feb-2009 07:24


Comments
(0000252)
BrianH
9-Jan-2009 21:56

Note: This only happens if the part value is smaller than the replacement length. CHANGE/part should insert the whole replacement value, replacing only the part specified.

This is the same as ticket #257
(0000403)
oldes
5-Feb-2009 00:14

And it's not only related to strings:
>> b: [1 2 3 4 5] change/part b 'x 3 b
== [x 2 3 4 5]
>> b: [1 2 3 4 5] change/part b 'x 5 b
== [x 2 3 4 5]
>> b: [1 2 3 4 5] change b 'x b
== [x 2 3 4 5]

The /part is simply ignored (not implemented).
(0000413)
BrianH
6-Feb-2009 21:18

This only happens if the part value is smaller than the replacement length (or more towards the head with position /part) - the /part is not ignored altogether.

>> data: "C# Rules" head change/part data "REBOL" 7
== "REBOLs"
>> data: "C# Rules" head change/part data "REBOL" skip data 7
== "REBOLs"

Note that in both cases 7 characters were replaced with the 5 in "REBOL". Behavior still as described, though with other series types as Oldes demonstrated. Note that /part position arguments act the same: if (and only if) the relative offset is less than the length of the replacement (or even negative) the length of the replacement overrides the offset.

Date User Field Action Change
26-Feb-2009 07:24 BrianH Status Modified built => tested
25-Feb-2009 18:09 carl Fixedin Modified => alpha 36
25-Feb-2009 18:09 carl Status Modified reviewed => built
9-Feb-2009 23:53 BrianH Comment : 0000413 Modified -
6-Feb-2009 21:18 BrianH Comment : 0000413 Added -
5-Feb-2009 00:14 oldes Comment : 0000403 Added -
20-Jan-2009 03:46 BrianH Comment : 0000252 Modified -
20-Jan-2009 03:45 BrianH Priority Modified none => high
10-Jan-2009 00:28 BrianH Version Modified => alpha 29
10-Jan-2009 00:28 BrianH Status Modified submitted => reviewed
10-Jan-2009 00:24 BrianH Comment : 0000252 Modified -
10-Jan-2009 00:15 BrianH Comment : 0000252 Modified -
9-Jan-2009 21:56 BrianH Comment : 0000252 Added -
2-Dec-2008 18:50 Admin Ticket Added -