zxul767 / lox

An interpreter for the Lox language
1 stars 0 forks source link

figure out whether we should emulate Python for `str::slice` #28

Open zxul767 opened 1 year ago

zxul767 commented 1 year ago

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)