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

Array slice #5

Open
Creepsky opened this issue Oct 14, 2018 · 0 comments
Open

Array slice #5

Creepsky opened this issue Oct 14, 2018 · 0 comments
Labels
enhancement New feature or request to do

Comments

@Creepsky
Copy link
Owner

Creepsky commented Oct 14, 2018

Add an built in array slicing method.
A slice has this type: identifier [&] identifier
A slice literal has this format: expression[range literal]

Idea:

i32 [] test;
i32 var1 = test[0]; // element 0
i32 [&] vars = test[0..5]; // elements 0 to 4
i32 [&] vars = test[..]; // all elements
i32 [&] vars = test[..5]; // elements 0 to 4
i32 [&] vars = test[5..]; // elements 5 to end
@Creepsky Creepsky added this to the Version 0.1.0.0 milestone Oct 14, 2018
@Creepsky Creepsky added enhancement New feature or request to do labels Oct 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request to do
Projects
None yet
Development

No branches or pull requests

1 participant