Why does Lua have no “continue” statement?

后端 未结 11 1710
无人及你
无人及你 2020-12-07 13:23

I have been dealing a lot with Lua in the past few months, and I really like most of the features but I\'m still missing something among those:

  • Why is there no
11条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-07 14:11

    I've never used Lua before, but I Googled it and came up with this:

    http://www.luafaq.org/

    Check question 1.26.

    This is a common complaint. The Lua authors felt that continue was only one of a number of possible new control flow mechanisms (the fact that it cannot work with the scope rules of repeat/until was a secondary factor.)

    In Lua 5.2, there is a goto statement which can be easily used to do the same job.

提交回复
热议问题