atom feed72 messages in org.w3.public-webapiRe: ACTION-87: Selectors API
FromSent OnAttachments
47 earlier messages
Anne van KesterenMay 13, 2006 12:26 pm 
lioreanMay 13, 2006 2:40 pm 
Anne van KesterenMay 14, 2006 7:20 am 
lioreanMay 14, 2006 4:22 pm 
Anne van KesterenMay 15, 2006 3:15 am 
lioreanMay 16, 2006 9:29 pm 
Anne van KesterenMay 17, 2006 5:18 am 
Lachlan HuntMay 17, 2006 6:19 am 
Anne van KesterenMay 17, 2006 6:30 am 
Jim LeyMay 17, 2006 6:35 am 
Lachlan HuntMay 17, 2006 7:02 am 
Robin BerjonMay 17, 2006 7:07 am 
Anne van KesterenMay 18, 2006 12:46 am 
Jonas SickingMay 30, 2006 3:11 pm 
Jonas SickingMay 30, 2006 3:24 pm 
Jonas SickingMay 30, 2006 3:42 pm 
Ian HicksonMay 30, 2006 3:55 pm 
Robin BerjonMay 30, 2006 4:15 pm 
Jonas SickingMay 30, 2006 5:56 pm 
Anne van KesterenJun 5, 2006 2:46 am 
Anne van KesterenJun 5, 2006 2:49 am 
Jonas SickingJun 5, 2006 12:31 pm 
Charles McCathieNevileJun 5, 2006 5:37 pm 
lioreanJun 5, 2006 6:16 pm 
Maciej StachowiakJun 5, 2006 10:40 pm 
Subject:Re: ACTION-87: Selectors API
From:Maciej Stachowiak (mj@apple.com)
Date:Jun 5, 2006 10:40:34 pm
List:org.w3.public-webapi

On Jun 5, 2006, at 6:16 PM, liorean wrote:

On Mon, 05 Jun 2006 19:49:36 +1000, Anne van Kesteren <ann@opera.com> wrote:

I'm not really fond of matchOne()... Is there any precedence on

this?

Not in JavaScript that I can think of. The only precedent case I can think of for this example is String.prototype.match.

For this reason I think "match" is a fine name for the single-result case. The default of regexp matching (likely the most familiar other match operation) is to give a single result. If there is to be another name it should be matchFirst though, not matchOne, to be clear that it's returning the first match not just some arbitrarily chose one.

I am with Jonas on this - I don't think the name hurts or increases confusion and it does slightly decrease it. But picking names is always painful. We'll never get it perfectly right, but we can always get it oh-so-very wrong :(

I tend to agree here. I don't like the suggested design of having selectors be second class though. I think selectors are important enough to have as first class objects, just like regex are. Compile them to an object once, use multiple times. Little is lost in performance for those using them once, but much is gained for those using them over and over.

1) This can be added later, if such use cases turn out to be important.

2) I think you are overestimating the available performance gains. Parsing the selector string is will likely be by far the least expensive part of the match operation.

Regards, Maciej