lua-users home
lua-l archive

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

On 22/06/2011 19.02, Roberto Ierusalimschy wrote:
As I said, I think I read in an old message by Roberto or Luiz (in
an old of those endless threads about the beauty of continue) that
Lua team wasn't in principle contrary to the introduction of
continue as a counterpart of break, but the problem was that it was
too tricky to get it right with the current (5.1.4) semantics of
repeat-until because of the possibility of bypassing the scope of a
local declared after the continue (*IIRC* - please feel free to
correct me if I'm wrong).

You are :) The problem with repeat-until was only a detail. The main
problem with continue was (and still is) that, for us, it is just one of
many different forms of "domesticated goto" and we did not see why to
include this one without including the others. (We could argue the
same about 'break', BTW.)

Thanks for the clarification! I really got It wrong! Sorry for the noise, then. :-)

BTW, what about the limit per-block as opposed to the current limit per-function?

Don't you think that the "per-function" approach limits the clean usage of goto in common foreseeable use cases?

It seems to me that with current approach goto will either be exclusive domain of code generators or be a source of ugly code. I had the impression that, although you don't want goto to be abused, you encourage its use in a clean way for those common cases.

Am I wrong here too? :-)

-- Roberto

-- Lorenzo