Skip to content

Conversation

@jbdoderlein
Copy link

This change is linked to this issue
The implementation is defined in this PR

The goal is to provide clear semantic for "out of bound" as stated at the end of examples :

Slices not do go "out of bounds". Instead they just stop at the end or beginning

The constraint on begin and end were changed to allow all possible slicing.
With L = [0,1,2,3,4,5,6,7,8,9]; :

Documentation Rascal v0.41.3
L[0..0] IndexOutOfBound []
L[..10] IndexOutOfBound [0,1,2,3,4,5,6,7,8,9]
L[10..10] IndexOutOfBound []

This definition is compatible with the use of negative index, and with the min/max, the constraint should hold (which was not the case before).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant