lua-users home
lua-l archive

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


On Jun 10, 2014 2:41 PM, "Axel Kittenberger" <axkibe@gmail.com> wrote:

> for loops always have been syntatic sugar easily replaceable with while loops (or now you can replace both even with goto loops).

Proper tail recursion means control flow may be expressed in function application via CPS-transform, and rather directly replacing while-loops. And foreach() was the loop construct once...

The for-loop gives terse syntax for binding locals using the iterator protocol. It's pretty convenient. The iterator protocol is one of the few points of commonality likely to be shared between code written by multiple authors independently.

An ongoing theme: how few details must independently-written code share in order to work together syntactically?