<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div apple-content-edited="true"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; "><div><div><span class="Apple-style-span" style="font-family: 'Lucida Grande'; font-size: 13px; ">I actually have to disagree with Pete and Ariel on this.<div>There are plenty of concepts that throw off the uninitiated, such as any scoping, or even the funky concept of defining a function in the method signature of another method.</div><div>
</div><div>And since the parameter is the last in the signature, it's completely transparent to people who don't need it.</div><div>The other downside I see to using a static method, besides the fact that it's harder to read is that doing it that way would create 2 function objects for every event.</div><div>What you would have would be:</div><div>function(){/*added by static bind*/</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span>function(){ /*proxy*/</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span>eventListener; /*actual method*/
</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span>}
</div><div>}
<div><br class="webkit-block-placeholder"></div><div>If you're going to need scope correction, chances are you're not just including jquery to do some minimal work, but rather building large applications (and hence, would probably be doing a lot of these calls, and would be more sensitive to performance).</div><div>
</div><div>Brandon, I like your API changes you made to the ticket, and overall, I think this looks good. I agree that consistency should be kept with other aspects of the library, but it's not as common, and I don't think it's important enough to derail this feature.</div><div>Thanks for taking a look at it :)</div><div>
</div><div>
</div></div></span><b>Nate Cavanaugh</b></div><div>Director of User Interface Engineering</div><div>Liferay, Inc.</div><div>Enterprise. Open Source. For life.</div></div><div>
</div></span></div></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"> </div>
<div><div>On May 4, 2009, at 7:08 AM, pete higgins wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>
I agree with Ariel, that this would be better served as a static
method. Dojo does the (fn, scope) (actually, we do a mixmatch and
allow curried args, but I digress) and it definitely is a learning
curve for js n00bs, and certainly not very jQuery-ish. by making it a
separate method, it becomes entirely opt-in for power users and is
nearly as concise as the proposed further overloading of the existing
signature.
I ported dojo's .hitch(), which is likely more in line with Ariel's statement.
<a href="http://higginsforpresident.net/js/jq.hitch.js">
http://higginsforpresident.net/js/jq.hitch.js</a>My $0.02US
Regards,
Peter