lua-users home
lua-l archive

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


On Thu, Aug 25, 2016 at 2:56 AM, Patrick Donnelly <batrick@batbytes.com> wrote:

> One of the advantages I see is that the for loop code block must follow good stack discipline

In a particular project I deal with, I'd say that half the table iteration code is complicated, with stack use heavily commented. And many of those complicated cases have nothing to pop at the end of the iteration, so the for-form would just look strange.

I'd say the while-from is idiomatic, and the consistency of its use makes those complicated cases easier to understand.

Cheers,
V.