Sets plus JSON

Rick Waldron waldron.rick at gmail.com
Wed Oct 3 13:01:51 PDT 2012


On Wed, Oct 3, 2012 at 3:36 PM, Brendan Eich <brendan at mozilla.org> wrote:

> Rick Waldron wrote:
>
>> On Wed, Oct 3, 2012 at 2:04 PM, Rick Waldron <waldron.rick at gmail.com<mailto:
>> waldron.rick at gmail.com**>> wrote:
>>
>>
>>
>>     On Wed, Oct 3, 2012 at 1:43 PM, Brandon Benvie
>>     <brandon at brandonbenvie.com <mailto:brandon at brandonbenvie.**com<brandon at brandonbenvie.com>>>
>> wrote:
>>
>>         Another options for Maps is to represent them as an array of
>>         [key, value].
>>
>>
>>     Which is a rough approximation of what a Map looks like internally.
>>
>>
>>
>> Sorry, this is incorrect. Map looks more like:
>>
>> [key1, key2]
>> [value1, value2]
>>
>> Sorry for confusion
>>
>
> As an implementation in ES5, maybe (O(n) lookup cost). But the thing to
> aim for is the shape of the Map parameter, and that looks like
>
> [[key1, value1], [key2, value2]]
>
> Still need type tagging to revive as a Map, of course.
>
> JSON object notation can't handle Map, though: key can be any value
> (ignore JSON not handling all JS values).



Ugh, sorry, I replied to myself/Dean above before reading ahead.

Rick

>
>
> /be
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121003/a167db84/attachment.html>


More information about the es-discuss mailing list