Alex Falcon (2017-06-03T00:37:58.000Z)
Main targeting - passing two and more arguments, mainly "instance, key"
sequences. Much function don't uses array value directly, but passing these
pairs (may have different reasons).
Mostly these indexes may constant, so just simply bake array/object
reference and index into one interface, and operate and simple variables,
or passing to function through spreads.

2017-06-03 2:50 GMT+08:00 T.J. Crowder <tj.crowder at farsightsoftware.com>:

> This is easily done in userland, is there a strong justification for new
> syntax for it?
>
> Quick example (https://jsfiddle.net/Ljm9gcmo/):
>
> ```js
> // Accessor
> const entryAccessor = (array, index) => {
>   return {
>     get value()  { return array[index]; },
>     set value(x) { array[index] = x; }
>   }
> };
>
> // Example usage
> const a = ["a", "b", "c"];
> const e = entryAccessor(a, 0);
> console.log(e.value); // "a"
> e.value = "A";
> console.log(e.value); // "A"
> ```
>
> If you wanted and don't object to modifying built-in prototypes, you could
> even put something on `Array.prototype` for it (non-enumerable, of course).
>
> -- T.J. Crowder
>
>
> On Fri, Jun 2, 2017 at 5:06 PM, Alex Falcon <capitalknew at gmail.com> wrote:
>
>> Hello. I heard about SIMD, Atomics, etc. and they accept as first
>> arguments "array, index", so because ES6 have spreads, I suggest to make
>> next things:
>>
>> let array = [0, 2, 3];
>> let ptr = array{0}; // don't get value, but pair of [array, 0], also this
>> is proxied which you have setter and getter "value"
>> let ptr = array.ptr(0); // alternate, functional
>>
>> ptr.value = 1; // setter
>> let acceptance = ptr.value; // getter
>>
>> // also you can just use these pointers without extra indexing
>> let idx = Atomics.add(...ptr, 1);
>>
>> It should available for both: typed and regular arrays.
>>
>>
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170603/1367bf6a/attachment.html>
capitalknew at gmail.com (2017-06-03T00:40:21.574Z)
Main targeting - passing two and more arguments, mainly "instance, key"
sequences. Much function don't uses array value directly, but passing these
pairs (may have different reasons).
Mostly these indexes may constant, so just simply bake array/object
reference and index into one interface, and operate like simple variables,
or passing to function through spreads.

Also, I forgot to press "Reply to All". 
capitalknew at gmail.com (2017-06-03T00:39:46.217Z)
Main targeting - passing two and more arguments, mainly "instance, key"
sequences. Much function don't uses array value directly, but passing these
pairs (may have different reasons).
Mostly these indexes may constant, so just simply bake array/object
reference and index into one interface, and operate like simple variables,
or passing to function through spreads.