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

配列で負のインデックス指定時、末尾からの順番で要素を取得するようにする #514

Open
FineArchs opened this issue Dec 22, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@FineArchs
Copy link
Member

pythonなどのように、例えば

let array=['hoge', 'fuga', 'piyo']
<: array[-1] // 'piyo'
<: array[-2] // 'fuga'

のようなことを出来るようにしたいです。

別案

[]内限定文法で、「配列の最後の要素のインデックス」を表す識別子を用意する。

// 例
let array=['hoge', 'fuga', 'piyo']
<: array[$] // 'piyo'
<: array[$ - 1] // 'fuga'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants