mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Update rfcs/generalized-iteration.md
Co-authored-by: dcope-rbx <91100513+dcope-rbx@users.noreply.github.com>
This commit is contained in:
parent
36802f0c75
commit
b5df447e5d
1 changed files with 1 additions and 1 deletions
|
@ -22,7 +22,7 @@ This proposal solves all of these by providing a way to implement uniform iterat
|
|||
|
||||
In Lua, `for vars in iter do` has the following semantics (otherwise known as the iteration protocol): `iter` is expanded into three variables, `gen`, `state` and `index` (using `nil` if `iter` evaluates to fewer than 3 results); after this the loop is converted to the following pseudocode:
|
||||
|
||||
```
|
||||
```lua
|
||||
while true do
|
||||
vars... = gen(state, index)
|
||||
index = vars... -- copy the first variable into the index
|
||||
|
|
Loading…
Add table
Reference in a new issue