You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a controversial interpretation of the /PART refinement on APPEND and INSERT which says that it refers to an integer length of how many units of the result series type should be used.
However, R3-Alpha doesn't quite heed this rule. It uses the length of the source series to clip that limit:
r3-alpha>> append/part "abc" ["defg"] 2
== "abcd" ; because the overall block is only length 1, it is clipped
r3-alpha>> append/part "abc" ["defg" "hijk"] 2
== "abcde" ; increasing the block size changes this around
Moreover, it probably should only accept an INTEGER!...as taking series positions for a /PART under this rule do not make sense! Red has that problem as well:
red>> append/part "abc" x: [100 "de" "fg"] next next x
== "abc10"
But it doesn't have the problem with the length clipping:
Resolves issue described here, by restricting the /PART refinement to
only take INTEGER!:
metaeducation/rebol-issues#2383
Required a change to REWORD as it was trying to pass in a series
position; this changes it to pass in an offset.
Uses unsigned integers in the implementation to reduce need for casting
in compiler warnings.
There is a controversial interpretation of the /PART refinement on APPEND and INSERT which says that it refers to an integer length of how many units of the result series type should be used.
#2096
However, R3-Alpha doesn't quite heed this rule. It uses the length of the source series to clip that limit:
This comes from a call to Partial1() which takes the source argument in the A_APPEND and A_INSERT case, which it then uses to make the clipping decision. Under the current stated rules of the game, it doesn't know where to clip, so it needs to leave that decision up to Modify_String().
Moreover, it probably should only accept an INTEGER!...as taking series positions for a /PART under this rule do not make sense! Red has that problem as well:
But it doesn't have the problem with the length clipping:
Though it does seem to interpret negative numbers in a nonsensical-seeming way:
The text was updated successfully, but these errors were encountered: