Update syntax-list-comprehensions.md

This commit is contained in:
James Napora 2022-02-13 16:40:11 -08:00 committed by GitHub
parent 14e40671fc
commit 5f0b8ae1be
Signed by: DevComp
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,7 +7,7 @@ Introduce a form of list comprehension using `n for-in-do` syntax.
List comprehensions would bring several benefits and prevent code smell. List comprehensions would bring several benefits and prevent code smell.
In Lua you are encouraged to not modify tables during traversal. In Lua you are encouraged to not modify tables during traversal.
When traversing a table to exclude all the odd numbers you'd be creating a large statement to get rid of them When traversing a table to exclude all the odd numbers you'd be creating a large statement to get rid of them, with list comprehensions this could be shortened
## Design ## Design