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
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)
The text was updated successfully, but these errors were encountered:
zxul767
changed the title
figure out whether we should emulate Python for str::slice
figure out whether we should emulate Python for str:sliceDec 6, 2022
zxul767
changed the title
figure out whether we should emulate Python for str:slice
figure out whether we should emulate Python for str::sliceDec 6, 2022
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
)The text was updated successfully, but these errors were encountered: