Python is quite lenient when it comes to the slices, e.g., list[0:10] for a list with less than 10 elements simply returns an empty list.
I suppose that this has a good rationale but I don't know it off the top of my head, so I think we should research it and see if it makes sense to adopt it for Lox. The current behavior simply emulates the Java API (String::substring)
Python is quite lenient when it comes to the slices, e.g.,
list[0:10]
for a list with less than 10 elements simply returns an empty list.I suppose that this has a good rationale but I don't know it off the top of my head, so I think we should research it and see if it makes sense to adopt it for Lox. The current behavior simply emulates the Java API (
String::substring
)