lua-users home
lua-l archive

Re: continue/repeat...until false dichotomy

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


* Brian Kelley:
> I've been reading this mailing list for quite a while now, and I've
> always been puzzled by the apparent consensus, documented in the FAQ,
> that continue is somehow incompatible with repeat ... until. The common
> example given is:
>
> repeat
> if cond then continue end
> local t = 1
> ...
> until t == 0
>
> Sure, that code looks broken, but where is the semantic conflict?
Make it:
 repeat
 local t = 0
 if cond then continue end
 local t = 1
 ...
 until t == 0
Then the two t are actually different variables (in the current
implementation), and it's not clear to which incarnation the
comparison refers.

AltStyle によって変換されたページ (->オリジナル) /