Separating a Hash type from Object
P T Withington
ptw at pobox.com
Wed May 2 04:58:26 PDT 2007
On 2007-05-02, at 02:40 EDT, Brendan Eich wrote:
> Indeed, #. etc. is just a thought experiment.
I do think there needs to be a primitive Hash type. Otherwise we
doom users to trying to invent their own and hitting all the various
pitfalls that have been enumerated on this thread.
The safety issue is that methods are visible as properties of an
instance. Putting the methods in a special namespace seems kludgey
to me. What is the benefit of methods being properties of an
instance? What if they were not?
Another thought experiment:
What if `foo.bar(...)` was syntactic sugar for `bar[typeof foo].apply
(foo, ...)`. Oh, wait, that's not quite right. Guess I have to
invent generic functions. Hm.
More information about the Es4-discuss