An alternative that was discussed at one point was to invert this idea:

* Arrays get the methods that Maps already have: `get(index)` and `set(index, 
value)`. Advantage: one could support negative indices. That is, the following 
two expressions would be equivalent.

    ```js
    arr.get(-1)
    arr.get(arr.length-1)
    ```

* Using brackets for accessing array elements is phased out.

That may be easier to achieve and would fit in well with ES6 collections.



> On 09 Apr 2015, at 21:38, Allen Wirfs-Brock <al...@wirfs-brock.com> wrote:
> 
> 
>> On Apr 9, 2015, at 2:37 PM, Jordan Harband <ljh...@gmail.com 
>> <mailto:ljh...@gmail.com>> wrote:
>> 
>> One advantage of this approach is that more "spec magic" can be implemented 
>> in terms of the language - it would also make subclassed arrays more 
>> versatile instead of having to always be a Proxy.
> 
> see http://wiki.ecmascript.org/doku.php?id=strawman:object_model_reformation 
> <http://wiki.ecmascript.org/doku.php?id=strawman:object_model_reformation>
-- 
Dr. Axel Rauschmayer
a...@rauschma.de
rauschma.de



_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to