Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zxul767 opened this issue Dec 6, 2022 · 0 comments
Open

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

zxul767 opened this issue Dec 6, 2022 · 0 comments

Comments

@zxul767
Copy link
Owner

zxul767 commented Dec 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)

@zxul767 zxul767 added the design label Dec 6, 2022
@zxul767 zxul767 changed the title figure out whether we should emulate Python for str::slice figure out whether we should emulate Python for str:slice Dec 6, 2022
@zxul767 zxul767 changed the title figure out whether we should emulate Python for str:slice figure out whether we should emulate Python for str::slice Dec 6, 2022
@zxul767 zxul767 added the p2 label Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant