Nov 16 meeting notes
dean at deanlandolt.com
Thu Nov 17 11:26:05 PST 2011
On Thu, Nov 17, 2011 at 1:16 PM, Waldemar Horwat <waldemar at google.com>wrote:
> On Thu, Nov 17, 2011 at 3:49 AM, Axel Rauschmayer <axel at rauschma.de>
> > Given that Array already uses `length`, it seems like the obvious choice.
> "length" is my choice as well, for the same reason. It's not writable
> in Maps and Sets, so the concerns about the semantics of writing it
> don't apply.
Who can resist such a juicy bikeshed...
Just wanted to jump in and say non-writable length is consistent with
String behavior as well, but David makes a good point about length implying
metric topology. David's suggestion of `count` is nice. ISTM what we're
talking about is `cardinality`, but no need to get too silly w/ precision.
Though `size` is just fine with me, and has plenty of prior art.
Whatever name is chosen I'd prefer it be something other than `length`, and
for it to also exist on Array.prototype as a read-only property returning
this.length. This way this new property becomes the new `length` for every
"compound" type, whether it be an object, array, string, map, set, etc. And
`length` would remain for all sequence (numerically-indexed) types.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss