winamp/Src/external_dependencies/openmpt-trunk/include/premake/website/docs/table.fold.md

31 lines
563 B
Markdown
Raw Normal View History

2024-09-24 12:54:57 +00:00
Merge two lists into an array of objects containing pairs of values, one from each list.
```lua
table.fold(arr1, arr2)
```
### Parameters ###
`arr1` and `arr2` are tables containing indexed values.
### Return Value ###
A new array of objects containing the corresponding elements from each list.
### Availability ###
Premake 5.0 or later.
### Examples ###
```lua
-- returns { {"A","X"}, {"B","Y"}, {"C","Z"} }
table.fold({ "A", "B", "C" }, { "X", "Y", "Z" })
-- returns { {"A","X"}, {"B","Y"}, {"C"} }
table.fold({ "A", "B", "C" }, { "X", "Y" })
```