-
Notifications
You must be signed in to change notification settings - Fork 35
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
1-click installer #3
Milestone
Comments
odino
added a commit
that referenced
this issue
Aug 25, 2019
This PR adds support for negative indexes in arrays / strings. ``` bash [1,2,3][-1] #3 ``` There is one change that might alter existing ABS scripts, and that's non-existing indexes, for strings, returning an empty string rather than `null`. I believe it's an ok thing to break as both will evaluate to `false` when casted to boolean, and to check whether an index exists one can simply: * check the length of the string (`s.len()`) * check the boolean value of the index (`!!s[idx]`) both these examples do not break with these changes. I instead admit that it would be weird to see code such as: ``` bash if s[idx] == null { ... } ``` rather than ``` if !s[idx] { ... } ``` So I guess this is a change that can go through, as it really shouldn't impact much of the userbase.
odino
added a commit
that referenced
this issue
Aug 25, 2019
This PR adds support for negative indexes in arrays / strings. ``` bash [1,2,3][-1] #3 ``` There is one change that might alter existing ABS scripts, and that's non-existing indexes, for strings, returning an empty string rather than `null`. I believe it's an ok thing to break as both will evaluate to `false` when casted to boolean, and to check whether an index exists one can simply: * check the length of the string (`s.len()`) * check the boolean value of the index (`!!s[idx]`) both these examples do not break with these changes. I instead admit that it would be weird to see code such as: ``` bash if s[idx] == null { ... } ``` rather than ``` if !s[idx] { ... } ``` So I guess this is a change that can go through, as it really shouldn't impact much of the userbase.
odino
added a commit
that referenced
this issue
Aug 25, 2019
This PR adds support for negative indexes in arrays / strings. ``` bash [1,2,3][-1] #3 ``` There is one change that might alter existing ABS scripts, and that's non-existing indexes, for strings, returning an empty string rather than `null`. I believe it's an ok thing to break as both will evaluate to `false` when casted to boolean, and to check whether an index exists one can simply: * check the length of the string (`s.len()`) * check the boolean value of the index (`!!s[idx]`) both these examples do not break with these changes. I instead admit that it would be weird to see code such as: ``` bash if s[idx] == null { ... } ``` rather than ``` if !s[idx] { ... } ``` So I guess this is a change that can go through, as it really shouldn't impact much of the userbase.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: