lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


From: "Alexander Gladysh"
Continue contradicts with my understanding of single exit point idiom.

I don't think single exit point theorem has any place in a language that has both a "return" statement and allows multiple returns. At least not to be followed religiously, or it'd lead to some terribly inefficient code.

Remembering that no programmer will be forced to use continue, I don't really see any negatives. Besides of course that it'll be hard to remove from the language at a later date, should it prove incompatible with some new syntax ;) (eg, the repeat until scope rule). Although it's rarely needed, the few times where is it currently require a complete code restructure, and possibly temporary state variables that would otherwise uneeded. Plus most people take it for granted that the language will support it. My vote goes for keep repeat untils, keep the repeat until scope, but throw an error if your continue jumps in to access of locals declared beneath it.

- Alex