Hacker News new | past | comments | ask | show | jobs | submit login

I feel that the array starting index should be adjustable at runtime via increment/decrement overloading for either the [ or ] character.

var var meanings = [42]!

print(meanings[-1])! //42

[++! //temporarily change to 0-based indexing

print(meanings[0])! //42

print(meanings[-1--])! //42 (because of the --] pre-decrement)




Does it even count as an esolang feature if it was a real feature in a commonly-used language for years?

https://perldoc.perl.org/5.20.0/arybase

It was even more fun in Perl 4, when $[ was program-scoped o_O


Might be worth opening a pull request! Lots of people might prefer starting at something more intuitive, like -0 or NaN




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: