REBOL3 tracker
  0.9.12 beta
Ticket #0001499 User: anonymous

Project:



rss
TypeBug Statustested Date19-Feb-2010 22:51
Versionalpha 97 CategoryMezzanine Submitted bymeijeru
PlatformAll Severityminor Prioritynormal

Summary REPLACE behaving differently with strings and binary values
Description I fear that REPLACE on binary values has a bug. The examples should be analogous but they aren't.
Example code
>> replace "abc" "bc" "c"
== "ac"
>> replace #{616263} #{6263} #{63}
== #{616363}

Assigned ton/a Fixed inalpha 98 Last Update6-May-2010 10:41


Comments
(0002039)
meijeru
20-Feb-2010 15:13

I think I have now found the error: in the source of REPLACE, the test which determines LEN does not cater for BINARY! type. It is probably assumed this is covered by ANY-STRING!, but that is not anymore the case.
(0002042)
BrianH
21-Feb-2010 22:52

Fixed in mezz-series.r 6989. Tweaked the doc strings too.

Note that non-binary search values will be converted by TO-BINARY, so the search value should be compatible with that. If you don't want the value converted with TO-BINARY, convert it yourself using the method you prefer.

Date User Field Action Change
6-May-2010 10:41 BrianH Fixedin Modified => alpha 98
6-May-2010 10:41 BrianH Status Modified pending => tested
21-Feb-2010 22:52 BrianH Status Modified submitted => pending
21-Feb-2010 22:52 BrianH Comment : 0002042 Added -
20-Feb-2010 15:13 meijeru Comment : 0002039 Added -
19-Feb-2010 22:52 meijeru Summary Modified REPLACE behaving differently with strings and boinary values => REPLACE behaving differently with strings and binary values
19-Feb-2010 22:52 meijeru Code Modified -
19-Feb-2010 22:51 meijeru Ticket Added -