```
[1,2,3](-1)
```

I will not beat this dead horse further, and it may be visually
undesirable, and/or hard to implement, but for what it's worth, the idea is
not to make arrays callable; it's just new syntax to allow parenthesized
expressions following arrays, which would be interpreted as an index whose
value to extract, with negative values meaning to go from the end.

On Tue, Jan 26, 2016 at 4:19 AM, Bergi <[email protected]> wrote:

> Bob Myers schrieb:
>
>> The syntactical construct `array()` is unused as far as I know, since
>> currently it would always generate a syntax error--an array is not a
>> function.
>>
>
> Thus we can use this as in
>>
>> ```
>> [1,2,3](-1)
>> ```
>>
>> Shouldn't break anything.
>>
>
> This would break much more than a `last` getter/method or `nth`/`at`
> method.
> Arrays becoming callable would mean that their `typeof` changes from
> `"object"` to `"function"`, which is a very bad idea.
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to