REBOL3 tracker
  0.9.12 beta
Ticket #0001772 User: anonymous

Project:



rss
TypeBug Statusbuilt Date20-Nov-2010 23:42
Versionalpha 110 CategoryNative Submitted bySunanda
PlatformAll Severityminor Prioritynormal

Summary LOWERCASE/part and UPPERCASE/part weird results with negative /part length
Description There seems to be no obvious justification for the number of characters uppercased in these examples:

str: copy "abcdefg" uppercase/part tail str -4 str
== "abcDefg"
str: copy "abcdefg" uppercase/part tail str -5 str
== "abCDEfg"
str: copy "abcdefg" uppercase/part tail str -6 str
== "aBCDEFg"

R2 generates an error in these cases:
>> str: copy "abcdefg" uppercase/part tail str -6 str
** Script Error: Value out of range: -6
** Near: uppercase/part tail str -6 str

But it would be better in R3 to use the same model for /part as COPY/part.
Example code
>> head uppercase/part tail "abcdefg" -4
== "abcDefg"  ; should be "abcDEFG"
>> head uppercase/part tail "abcdefg" -5
== "abCDEfg"  ; should be "abCDEFG"
>> head uppercase/part tail "abcdefg" -6
== "aBCDEFg"  ; should be "aBCDEFG"
>> head lowercase/part tail "ABCDEFG" -4
== "ABCdEFG"  ; should be "ABCdefg"
>> head lowercase/part tail "ABCDEFG" -5
== "ABcdeFG"  ; should be "ABcdefg"
>> head lowercase/part tail "ABCDEFG" -6
== "AbcdefG"  ; should be "Abcdefg"

Assigned ton/a Fixed inalpha 111 Last Update21-Nov-2010 22:50


Comments
(0002911)
BrianH
21-Nov-2010 21:20

R2's error is not a good idea in this case. It is better to act like COPY/part.
(0002913)
BrianH
21-Nov-2010 22:50

Whoops, I reverted the built status when I added LOWERCASE to the ticket. Is LOWERCASE fixed too?

Date User Field Action Change
21-Nov-2010 22:50 BrianH Comment : 0002913 Added -
21-Nov-2010 22:25 BrianH Fixedin Modified => alpha 111
21-Nov-2010 22:25 BrianH Status Modified reviewed => built
21-Nov-2010 21:37 BrianH Summary Modified Odd result with UPPERCASE/PART => LOWERCASE/part and UPPERCASE/part weird results with negative /part length
21-Nov-2010 21:37 BrianH Code Modified -
21-Nov-2010 21:37 BrianH Fixedin Modified alpha 111 => none
21-Nov-2010 21:37 BrianH Status Modified built => reviewed
21-Nov-2010 21:33 carl Fixedin Modified => alpha 111
21-Nov-2010 21:33 carl Status Modified reviewed => built
21-Nov-2010 21:20 BrianH Comment : 0002911 Added -
21-Nov-2010 21:18 BrianH Description Modified -
21-Nov-2010 21:18 BrianH Code Modified -
21-Nov-2010 21:18 BrianH Status Modified submitted => reviewed
20-Nov-2010 23:42 sunanda Ticket Added -