adobe / json-formula

Query language for JSON documents
http://opensource.adobe.com/json-formula/
Apache License 2.0
19 stars 8 forks source link

Slice expression rules mistake in specification #148

Closed Eswcvlad closed 4 months ago

Eswcvlad commented 5 months ago

Specifically this line:

If no stop position is given, it is assumed to be the length of the array if the given step is greater than 0 or 0 if the given step is less than 0.

When step is negative, it is not equivalent to 0, but to -length-1 both in Python and in the json-formula implementation, as with 0 first element is not included: