-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
APPEND/PART refinement clips output if shorter than input block #2383
Comments
hostilefork
added a commit
to metaeducation/ren-c
that referenced
this issue
Jul 23, 2019
Resolves issue described here: metaeducation/rebol-issues#2383 Uses unsigned integers to reduce need for casting in compiler warnings.
hostilefork
added a commit
to metaeducation/ren-c
that referenced
this issue
Jul 23, 2019
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.
Is there any proposition what should be results for above cases? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: