Can we also get goto statements? Also, if we going to do gotos, then please implement computed GOTO. FORTRAN has had that already for like 50 years.
Bob ---------- Forwarded message ---------- > From: "Sébastien Doeraene" <[email protected]> > To: Emanuel Allen <[email protected]> > Cc: "[email protected]" <[email protected]> > Date: Wed, 20 May 2015 22:38:09 +0200 > Subject: Re: Label statement moveable > Hi, > > On Wed, May 20, 2015 at 7:46 PM, Emanuel Allen <[email protected]> > wrote: > >> So my first attempt example would actually be rewritten to: >> var i; >> foo:{ >> if(typeof i!=='number') break; >> i+=1; >> } >> I =0; >> { >> if (i < 5); >> continue foo; >> } >> >> console.log(i);//log 4 >> >> Again the true aim for this is to lower function calls. >> > > And what about this, which is the *exact* equivalent of your code, without > even a label: > > var i = 0; > do { > if (typeof i !== 'number') break; > i += 1; > } while (i < 5); > console.log(i); > > (Btw, in this instance, the "typeof" test is not necessary at all. I left > it there to better see the connection with the original code.) > > You really don't need what you think you need. If you want to "lower > functions", you can just as well inline them *where they're supposed to be > called*, instead of above or at any arbitrary place, which nulls out the > need for "goto" statements. > > I also fail to see whether you're approaching this problem from the point > of view of a) write this by hand, or b) the output of a compiler. Your text > suggests a), but the code can obviously be written easily in the do..while > form I wrote over there, in a much more readable way, so the write-by-hand > hypothesis seems weird, which suggests b). Could you make this clearer? > > Cheers, > Sébastien >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

