Nov 16 meeting notes

David Bruant bruant.d at
Thu Nov 17 04:52:06 PST 2011

Le 17/11/2011 12:49, Axel Rauschmayer a écrit :
>>>     Map/Set:
>>>     Size property should be a getter property with no matching
>>>     setter.  It's defined on the property.
>>>     What is its name?  size, count, or length?  Decide on es-discuss.
> Given that Array already uses `length`, it seems like the obvious choice.
Or is it?
Array 'length' has some semantics. When you reduce it, elements get
removed. This won't be true for maps and sets.
Also, maybe it's because i'm a non-native English speaker, but for me
'length' refers to a measurement with something like a ruler. You start
at 0 and see up to where it goes. This is very accurate for an array
which is an indexed set (starting at 0 and growing) and for arrays as
considered in C (continuous sequence of bytes) which ECMAScript arrays
seem inspired of.
This is probably less relevant for unordered collections such as sets
which I'd tend to consider as a messy bag. For sets, 'count' sounds more
relevant to me.
I think I would go for 'count' as well for maps.

> Some of the things discussed should probably considered in the wider
> context of a well-designed collection library. Is anyone working on
> such a thing? Should there be efforts to make it happen (whether
> inside TC39 or externally, whether via a single party or via multiple
> parties)? It might not make it into, but it could inform
> decisions. Such a library is such a core element of a programming
> language that we should have a good one as soon as possible. The same
> holds for other utility functionality (IMHO, is still too
> frugal in this department).
What more than existing arrays, and upcoming map and set would you suggest?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list