On Wed, Aug 7, 2013 at 1:24 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Wed, Aug 7, 2013 at 11:29 AM, Allen Wirfs-Brock
> <allen@wirfs-brock.com> wrote:
> > ES6 already has an Array.prototype.find method so you would probably
> want to
> > name your 'find' method 'findSelector' or something else. Perhaps, it
> > shouldn't even include the word 'find' because it isn't clear to me that
> the
> > result is necessarily an element of the original collection. Why not
> just
> > call these methods of Elements 'querySelector' and 'querySelectorAll'?
>
> Yeah, now that we have Array#find, I think "find" isn't the best name
> for this. We were using it because that's what jQuery used.
>
> We don't want qS or qSA, because those names are way too long.
> However, IRC chatter led to the discussion of using "select()" as the
> method name, which seems pretty good.
>
> On Wed, Aug 7, 2013 at 11:57 AM, Allen Wirfs-Brock
> <allen@wirfs-brock.com> wrote:
> > On Aug 7, 2013, at 8:06 AM, Anne van Kesteren wrote:
> >> On Mon, Aug 5, 2013 at 4:48 PM, Allen Wirfs-Brock <
> allen@wirfs-brock.com> wrote:
> >>> We can't prevent people from writing poor code, but we don't have to
> be an enabler of it.
> >>
> >> As I understand things, part of the goal of TC39 is to be able to
> >> explain the platform in terms of JavaScript. Currently the platform
> >> has a ton of these identity checks. "Is /x/ a node", "is /x/ an
> >> element", etc. We should be able to explain those and I hope that
> >> symbols are going to give us that, although it will depend on the
> >> specifics I suppose.
> >
> > Actually, for ES6 it's looking like WeakArray is going to be your best
> bet for cases where such tests where the branding really needs to be
> unforgeable.
>
> Do you mean WeakSet, or is there some WeakArray object that's going to
> be added later? (I guess an ordered WeakSet, more or less?)
>
There is no WeakArray in ES6. Allen must have meant WeakSet or WeakMap,
both of which would fit this use case.
Allen, please confirm. Thanks.
>
> ~TJ
>
>
--
Cheers,
--MarkM