David Herman wrote:
On Mar 6, 2012, at 1:50 PM, Brendan Eich wrote:

Just replied to Isaac on this. We run into the completion-value leak objection 
and I do not see a way around it.

One way around it is to question the hazard. :)

Seriously, whether

     {|x| f() }

or

     (x) { f() }

is more likely to be an accidental leak is an empirical question, and not one I 
can guess just by looking at the syntax.

Yes, the dilemma has only an empirical (a posteriori) answer, if any. It could be YMMV.

But one design option is to avoid making a thing that looks like a function body today, where no completion-value leak hazard exists. An expression body is presumed useful and manifestly the return value. You get what you ask for.

The risk here may be small but people have run into it before in CL and other LISPs and expression languages. It's a bit scary in JS, what with OCAP the fundamental security model. So I don't think we should treat it lightly and TC39 has not, so far.

/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to