GH-39131: [JS] Add at() for array like types#40712
GH-39131: [JS] Add at() for array like types#40712domoritz wants to merge 2 commits intoapache:mainfrom
Conversation
|
|
|
@trxcllnt and I agreed offline to wrap indexes accesses so that any index is valid. The behavior in js is to only index -length ... length and return undefined otherwise but that seems less consistent than to just always wrap. Also, the types can be composer since we never return undefined. |
There was a problem hiding this comment.
-1 for renaming get() to at(). I'm fine adding at(), but get() and set() are equivalent to accessing an element by subscript index, e.g. x = xs[0] and xs[0] = x.
We've tried to get rid of them in the past in favor of proxies, but they're still the fastest way to access elements besides enumerating the data directly (via iterators or arraybuffers).
|
I see. So you are saying we should keep the get visitor and just make Isn't |
|
Redone in #40730 |
Simpler version of apache#40712 that preserves `get`. * GitHub Issue: apache#39131
Simpler version of apache#40712 that preserves `get`. * GitHub Issue: apache#39131
Simpler version of apache/arrow#40712 that preserves `get`. * GitHub Issue: #39131
Arrays in JavaScript have
atinstead ofgetso here we are making our arrays more consistent.This PR still maintains support for
getbut deprecates it. We can removegetafter one version of supporting both.atfor array like types #39131