BTF Measurements

Kevin Smith khs4473 at gmail.com
Tue Mar 13 11:12:23 PDT 2012


>
> Kevin, do you have time to attempt this?
>

Short answer: no.  : )

I think the previous analysis is undercounting potential "expression
functions".  Consider the following case:

    IO.File.readText(path, text => { console.log(text) });

Since we don't care what the callback returns, we could potentially rewrite
it as an "expression function":

    IO.File.readText(path, text => console.log(text));

I've rerun the analysis, creating another category for these single
statement functions
(spreadsheet<https://docs.google.com/spreadsheet/ccc?key=0Aro5yQ2fa01xdEJySWxhZ1VoZ0VaWTdldXp4NUtJd3c#gid=0>).
 If we include this extra category, then about half of the BTF candidates
may be suitable for rewriting as "expression functions" (depending on
whether the return value is significant in context).

This suggests that multi-statement and expression-type BTFs should be given
about equal priority with regard to syntax.

kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120313/089c3515/attachment.html>


More information about the es-discuss mailing list