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
The concept of a slicing operator will be introduced to the framework and its libraries: Using $value('start:stop') will return a slice of the respective value from start until stop - 1, as an instance of the value.
Rationale
Unified syntax for accessing slices in lists and buffers.
Functionality
$value('start:stop') # items start through stop-1$value('start:') # items start through the rest of the items in value$value(':stop') # items from the beginning through stop-1$value(':') # a copy of the whole value
Supports negative offsets for counting from the end of the underlying value instead of from the start.
Scope of Change
The concept of a slicing operator will be introduced to the framework and its libraries: Using
$value('start:stop')
will return a slice of the respective value from start until stop - 1, as an instance of the value.Rationale
Unified syntax for accessing slices in lists and buffers.
Functionality
$value([0, 4])
start:stop:step
) syntaxImplementation
This is implemented using the __invoke method, see e.g. xp-framework/core#349
Security considerations
n/a
Speed impact
n/a
Dependencies
n/a
Related documents
The text was updated successfully, but these errors were encountered: