On Wed, Oct 19, 2011 at 10:27 AM, Axel Rauschmayer <a...@rauschma.de> wrote:

> Problem: How do you invoke methods on table?
>>
>
> table.tellAxel = function() {alert('here is a method call');};
> table['tellAxel'] = function() {alert('here is a function entry");};
> table.tellAxel();  // here is a method call
> table['tellAxel'].apply(null,[]);  // here is a function entry
>
>
>> Using AWB’s terminology, accessing properties is part of the program
>> definition domain, accessing collection elements is part of the application
>> data domain. And it’s better not to mix the two.
>>
>
> Yes, that is exactly the point.
>
>
> So you are arguing in favor of approach #1, right?
>

No, I am arguing against changing the meaning of [] on 'object'.


> Then I would make “your” Map a subtype of Object. typeof is currently best
> limited to primitives (and to distinguishing them from objects), so
> introducing a new result would suggest adding a new primitive.
>

No, the goal is exactly to distinguish collections from objects.


> But I don’t think that is necessary: Once the semantics of [] have been
> changed in accordance with approach #1 then you can just write a library
> that provides Maps and other collections.
>

We disagree. I don't want to fix old code, it works, let it be. I want new
code to have a great new option. New tools can migrate developers to new
options. And these things can happen in our lifetime.

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

Reply via email to