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

Slicing operator [:] #789

Open
emil14 opened this issue Nov 28, 2024 · 0 comments
Open

Slicing operator [:] #789

emil14 opened this issue Nov 28, 2024 · 0 comments
Assignees

Comments

@emil14
Copy link
Collaborator

emil14 commented Nov 28, 2024

I don't see anything bad in having [:] syntax sugar for Slice component

#extern(list list_slice, string string_slice, bytes byte_slice)
pub def Slice<T list<any> | string | bytes>(from int, to int) (T)

I think it should work as in Python, but we need to make sure it's type-safe (and if that even possible)

Related to #28

@emil14 emil14 self-assigned this Nov 28, 2024
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