I still need to think in terms of creating garbage ... being "unaware" of
optimizations behind the scene.
I like to believe compilers should help optimizing for me instead of me
developing to simplify compilers job so despite how complicated would be
behind the scene I meant a `do { try/catch }` while I need to write a
one-shot inline invoked function, needing to think about the context (arrow
simplifies this part) inner scope, strict behavior ... etc etc ... yet I
meant a `do { try/catch }` and/or an expression, not an invoke.
Once again, not a big deal: the arrow solves but it feels to me like a
little necessary hack.
Regards
On Wed, Jan 8, 2014 at 9:35 AM, François REMY <[email protected]
> wrote:
> Please note that you do not really create a one-shot function and garbage
> in this case, at least if the compiler does his job well. The F# compiler,
> and probably many functional language compilers, would correctly inline the
> lambda function here.
>
>
>
> There’s probably no reason a JavaScript compiler couldn’t do the same here
> (and if this becomes a very used pattern, there will be traction to make
> sure this works well).
>
>
>
>
>
> Still bugs me by design we need to create garbage, including one-shot
> functions, in order to inline a try/catch to assign to a single "pointer"
>
>
>
> ```javascript
>
> const ES6_PROXY = ()=>{
>
> try {
>
> new Proxy({},{});
>
> return true;
>
> } catch(o_O) {
>
> return false;
>
> }
>
> }();
>
> ```
>
>
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss