lua-users home
lua-l archive

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

>I have a question about the design of Lua's for loop.

See the full lua-l archive and enjoy the heated discussions about this in the
past (when we decided against "for") and then more recently when we added "for".

You are right: the more verbose syntax would be more natural but it would also
introduce new reserved words, such as "to" and "step", which would probably
break some programs ("step" in specially dangerous here).

In a recent interview, Dennis Richie, father of C, said:

 "if your new language does begin to grow in usage,
 it can become really hard to fix early mistakes."

I consider the "for" syntax a good compromise, but yes, it looks like FORTRAN,
and this is not so bad as it may sound.