(Almost) everything is expression
Dmitry Soshnikov
dmitry.soshnikov at gmail.com
Fri Nov 11 10:29:36 PST 2011
On 11.11.2011 22:25, gaz Heyes wrote:
> On 11 November 2011 18:01, Dmitry Soshnikov
> <dmitry.soshnikov at gmail.com <mailto:dmitry.soshnikov at gmail.com>> wrote:
>
> var foo = {
> // do stuff
> 100;
> };
>
>
> What would be the result of a labelled statement? You'd need labels to
> work within expressions since you'd probably want to do:
> x=loop:for(i=0;i<10;i++){
> }
>
> but then what if you do:
> x=1/loop:for(i=0;i<10;i++){
> }
>
> Is 1 divided by the result of the for loop or is it divided by undefined?
This is why the topic is called "*(Almost)* everything...". In general
case we may not include this case with label-statement into proposal,
since the construction you wrote isn't practice IMO. But, we should
consider also theoretical things and this case it can be better to avoid
the case at all then to solve it -- especially if there is no much
profit in practice from it. Though, if we can manage it, why not?
Dmitry.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20111111/9835da56/attachment.html>
More information about the es-discuss
mailing list