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

Add a "last()" function that is like (len()-1) #11

Open
TomOnTime opened this issue Oct 3, 2016 · 1 comment
Open

Add a "last()" function that is like (len()-1) #11

TomOnTime opened this issue Oct 3, 2016 · 1 comment

Comments

@TomOnTime
Copy link

A major source of off-by-one errors for me is that with 0-based indexing there is no simple way to know the last element in an array. len(foo)-1 is convoluted.

Feature request: last(foo) should be the same as (len(foo)-1) thus making the intent very clear.

@vrok
Copy link
Owner

vrok commented Oct 3, 2016

That's a good idea and I thing we should implement it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants