--
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lua-l+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/lua-l/CABt16q%3DOeM5FDZcQJtD4bkcvAbDFs-ReD1EySzt6S3vA7%3D1Cfg%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lua-l+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/lua-l/95681ab2-2393-4cf6-b2d1-5252ddcedbb3n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lua-l+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/lua-l/CAAbgU5iBw7Wenb0fKWL%3D86wtE0aangCCU%3DvoRZ5G53EA8Oj8zg%40mail.gmail.com.
Dear maintainers of the Lua projectI cannot understand why you made the variable looped by the for loop read-only in Lua 5.5.
I think this restriction is completely unnecessary.In many programming languages, we can modify the control variables in the loop.

I am sorry that I forget it. Thank you all for your replies. I hope lua will get better and better in the future. Thank you so much for taking the time to reply despite your busy schedules. I now understand the change😉.在2025年12月24日星期三 UTC+8 01:32:25<Francisco Olarte> 写道:On Tue, 23 Dec 2025 at 10:18, Cheese <justlike...@gmail.com> wrote:Dear maintainers of the Lua projectI cannot understand why you made the variable looped by the for loop read-only in Lua 5.5.....I think this restriction is completely unnecessary.In many programming languages, we can modify the control variables in the loop.And in many others you can not. The restriction makes the special properties ( since 5.1 ) of the control variable explicit and helps avoid mistakes. Letting you modify it and then forgetting modifications can lead to puzzling behaviour. It is unnecessary, but it will probably be a lurking mousetrap even for me.I like it better this way. As said, just local i=i gets you the 5.4 behaviour.