diff options
| author | Li Jin <dragon-fly@qq.com> | 2026-02-28 16:52:40 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2026-02-28 16:52:40 +0800 |
| commit | 394ee0f64a0dc022f1dab86213d4771982ecf987 (patch) | |
| tree | 742623d81f4fdd5a2c4998a7735634fcd79ac5e9 /doc | |
| parent | 7555271be61990fd5020eac48fc80d6a24886b9c (diff) | |
| download | yuescript-394ee0f64a0dc022f1dab86213d4771982ecf987.tar.gz yuescript-394ee0f64a0dc022f1dab86213d4771982ecf987.tar.bz2 yuescript-394ee0f64a0dc022f1dab86213d4771982ecf987.zip | |
Updated docs.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/docs/de/doc/language-basics/operator.md | 26 | ||||
| -rw-r--r-- | doc/docs/doc/language-basics/operator.md | 26 | ||||
| -rw-r--r-- | doc/docs/id-id/doc/language-basics/operator.md | 26 | ||||
| -rw-r--r-- | doc/docs/pt-br/doc/language-basics/operator.md | 26 | ||||
| -rw-r--r-- | doc/docs/zh/doc/language-basics/operator.md | 26 | ||||
| -rw-r--r-- | doc/yue-de.md | 14 | ||||
| -rw-r--r-- | doc/yue-en.md | 14 | ||||
| -rw-r--r-- | doc/yue-id-id.md | 14 | ||||
| -rw-r--r-- | doc/yue-pt-br.md | 14 | ||||
| -rw-r--r-- | doc/yue-zh.md | 14 |
10 files changed, 200 insertions, 0 deletions
diff --git a/doc/docs/de/doc/language-basics/operator.md b/doc/docs/de/doc/language-basics/operator.md index 3be5ec8..5deec6a 100644 --- a/doc/docs/de/doc/language-basics/operator.md +++ b/doc/docs/de/doc/language-basics/operator.md | |||
| @@ -138,6 +138,8 @@ tbA[] = ...tbB | |||
| 138 | 138 | ||
| 139 | Du kannst Array-Tabellen oder Hash-Tabellen mit dem Spread-Operator `...` vor Ausdrücken in Tabellenliteralen zusammenführen. | 139 | Du kannst Array-Tabellen oder Hash-Tabellen mit dem Spread-Operator `...` vor Ausdrücken in Tabellenliteralen zusammenführen. |
| 140 | 140 | ||
| 141 | Wenn in ein Tabellenliteral mit geschweiften Klammern gespreadet wird (zum Beispiel `{...other}`), werden sowohl der Array-Teil als auch der Hash-Teil der Lua-Tabelle kopiert. | ||
| 142 | |||
| 141 | ```yuescript | 143 | ```yuescript |
| 142 | parts = | 144 | parts = |
| 143 | * "Schultern" | 145 | * "Schultern" |
| @@ -176,6 +178,30 @@ merge = {...a, ...b} | |||
| 176 | 178 | ||
| 177 | </YueDisplay> | 179 | </YueDisplay> |
| 178 | 180 | ||
| 181 | ### List-Tabellen-Spread | ||
| 182 | |||
| 183 | Wenn in ein Tabellenliteral mit eckigen Klammern gespreadet wird (zum Beispiel `[...other,]`), wird nur der Array-Teil kopiert. | ||
| 184 | |||
| 185 | ```yuescript | ||
| 186 | source = {1, 2, 3, name: "Yue"} | ||
| 187 | fullCopy = {...source} | ||
| 188 | listCopy = [...source,] | ||
| 189 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 190 | -- listCopy => [1, 2, 3] | ||
| 191 | ``` | ||
| 192 | |||
| 193 | <YueDisplay> | ||
| 194 | |||
| 195 | ```yue | ||
| 196 | source = {1, 2, 3, name: "Yue"} | ||
| 197 | fullCopy = {...source} | ||
| 198 | listCopy = [...source,] | ||
| 199 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 200 | -- listCopy => [1, 2, 3] | ||
| 201 | ``` | ||
| 202 | |||
| 203 | </YueDisplay> | ||
| 204 | |||
| 179 | ## Umgekehrter Tabellenindex | 205 | ## Umgekehrter Tabellenindex |
| 180 | 206 | ||
| 181 | Mit dem Operator **#** kannst du auf die letzten Elemente einer Tabelle zugreifen. | 207 | Mit dem Operator **#** kannst du auf die letzten Elemente einer Tabelle zugreifen. |
diff --git a/doc/docs/doc/language-basics/operator.md b/doc/docs/doc/language-basics/operator.md index caeb6f4..067aa66 100644 --- a/doc/docs/doc/language-basics/operator.md +++ b/doc/docs/doc/language-basics/operator.md | |||
| @@ -138,6 +138,8 @@ tbA[] = ...tbB | |||
| 138 | 138 | ||
| 139 | You can concatenate array tables or hash tables using spread operator `...` before expressions in table literals. | 139 | You can concatenate array tables or hash tables using spread operator `...` before expressions in table literals. |
| 140 | 140 | ||
| 141 | When spreading into a brace table literal (for example, `{...other}`), both the array part and hash part of the Lua table are copied. | ||
| 142 | |||
| 141 | ```yuescript | 143 | ```yuescript |
| 142 | parts = | 144 | parts = |
| 143 | * "shoulders" | 145 | * "shoulders" |
| @@ -176,6 +178,30 @@ merge = {...a, ...b} | |||
| 176 | 178 | ||
| 177 | </YueDisplay> | 179 | </YueDisplay> |
| 178 | 180 | ||
| 181 | ### List Table Spreading | ||
| 182 | |||
| 183 | When spreading into a bracket table literal (for example, `[...other,]`), only the array part is copied. | ||
| 184 | |||
| 185 | ```yuescript | ||
| 186 | source = {1, 2, 3, name: "Yue"} | ||
| 187 | fullCopy = {...source} | ||
| 188 | listCopy = [...source,] | ||
| 189 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 190 | -- listCopy => [1, 2, 3] | ||
| 191 | ``` | ||
| 192 | |||
| 193 | <YueDisplay> | ||
| 194 | |||
| 195 | ```yue | ||
| 196 | source = {1, 2, 3, name: "Yue"} | ||
| 197 | fullCopy = {...source} | ||
| 198 | listCopy = [...source,] | ||
| 199 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 200 | -- listCopy => [1, 2, 3] | ||
| 201 | ``` | ||
| 202 | |||
| 203 | </YueDisplay> | ||
| 204 | |||
| 179 | ## Table Reversed Indexing | 205 | ## Table Reversed Indexing |
| 180 | 206 | ||
| 181 | You can use the **#** operator to get the last elements of a table. | 207 | You can use the **#** operator to get the last elements of a table. |
diff --git a/doc/docs/id-id/doc/language-basics/operator.md b/doc/docs/id-id/doc/language-basics/operator.md index b2b1003..68c96e6 100644 --- a/doc/docs/id-id/doc/language-basics/operator.md +++ b/doc/docs/id-id/doc/language-basics/operator.md | |||
| @@ -138,6 +138,8 @@ tbA[] = ...tbB | |||
| 138 | 138 | ||
| 139 | Anda bisa menggabungkan tabel array atau tabel hash menggunakan operator spread `...` sebelum ekspresi di literal tabel. | 139 | Anda bisa menggabungkan tabel array atau tabel hash menggunakan operator spread `...` sebelum ekspresi di literal tabel. |
| 140 | 140 | ||
| 141 | Saat melakukan spread ke literal tabel dengan kurung kurawal (misalnya `{...other}`), bagian array dan bagian hash dari tabel Lua akan disalin. | ||
| 142 | |||
| 141 | ```yuescript | 143 | ```yuescript |
| 142 | parts = | 144 | parts = |
| 143 | * "shoulders" | 145 | * "shoulders" |
| @@ -176,6 +178,30 @@ merge = {...a, ...b} | |||
| 176 | 178 | ||
| 177 | </YueDisplay> | 179 | </YueDisplay> |
| 178 | 180 | ||
| 181 | ### Penyebaran Tabel List | ||
| 182 | |||
| 183 | Saat melakukan spread ke literal tabel dengan kurung siku (misalnya `[...other,]`), hanya bagian array yang disalin. | ||
| 184 | |||
| 185 | ```yuescript | ||
| 186 | source = {1, 2, 3, name: "Yue"} | ||
| 187 | fullCopy = {...source} | ||
| 188 | listCopy = [...source,] | ||
| 189 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 190 | -- listCopy => [1, 2, 3] | ||
| 191 | ``` | ||
| 192 | |||
| 193 | <YueDisplay> | ||
| 194 | |||
| 195 | ```yue | ||
| 196 | source = {1, 2, 3, name: "Yue"} | ||
| 197 | fullCopy = {...source} | ||
| 198 | listCopy = [...source,] | ||
| 199 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 200 | -- listCopy => [1, 2, 3] | ||
| 201 | ``` | ||
| 202 | |||
| 203 | </YueDisplay> | ||
| 204 | |||
| 179 | ## Indeks Balik Tabel | 205 | ## Indeks Balik Tabel |
| 180 | 206 | ||
| 181 | Anda dapat menggunakan operator **#** untuk mendapatkan elemen terakhir dari tabel. | 207 | Anda dapat menggunakan operator **#** untuk mendapatkan elemen terakhir dari tabel. |
diff --git a/doc/docs/pt-br/doc/language-basics/operator.md b/doc/docs/pt-br/doc/language-basics/operator.md index e0c0872..976cb43 100644 --- a/doc/docs/pt-br/doc/language-basics/operator.md +++ b/doc/docs/pt-br/doc/language-basics/operator.md | |||
| @@ -138,6 +138,8 @@ tbA[] = ...tbB | |||
| 138 | 138 | ||
| 139 | Você pode concatenar tabelas de array ou tabelas hash usando o operador spread `...` antes de expressões em literais de tabela. | 139 | Você pode concatenar tabelas de array ou tabelas hash usando o operador spread `...` antes de expressões em literais de tabela. |
| 140 | 140 | ||
| 141 | Ao fazer spread em um literal de tabela com chaves (por exemplo, `{...other}`), tanto a parte de array quanto a parte hash da tabela Lua são copiadas. | ||
| 142 | |||
| 141 | ```yuescript | 143 | ```yuescript |
| 142 | parts = | 144 | parts = |
| 143 | * "shoulders" | 145 | * "shoulders" |
| @@ -176,6 +178,30 @@ merge = {...a, ...b} | |||
| 176 | 178 | ||
| 177 | </YueDisplay> | 179 | </YueDisplay> |
| 178 | 180 | ||
| 181 | ### Spread de tabela de lista | ||
| 182 | |||
| 183 | Ao fazer spread em um literal de tabela com colchetes (por exemplo, `[...other,]`), apenas a parte de array é copiada. | ||
| 184 | |||
| 185 | ```yuescript | ||
| 186 | source = {1, 2, 3, name: "Yue"} | ||
| 187 | fullCopy = {...source} | ||
| 188 | listCopy = [...source,] | ||
| 189 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 190 | -- listCopy => [1, 2, 3] | ||
| 191 | ``` | ||
| 192 | |||
| 193 | <YueDisplay> | ||
| 194 | |||
| 195 | ```yue | ||
| 196 | source = {1, 2, 3, name: "Yue"} | ||
| 197 | fullCopy = {...source} | ||
| 198 | listCopy = [...source,] | ||
| 199 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 200 | -- listCopy => [1, 2, 3] | ||
| 201 | ``` | ||
| 202 | |||
| 203 | </YueDisplay> | ||
| 204 | |||
| 179 | ## Indexação reversa de tabela | 205 | ## Indexação reversa de tabela |
| 180 | 206 | ||
| 181 | Você pode usar o operador **#** para obter os últimos elementos de uma tabela. | 207 | Você pode usar o operador **#** para obter os últimos elementos de uma tabela. |
diff --git a/doc/docs/zh/doc/language-basics/operator.md b/doc/docs/zh/doc/language-basics/operator.md index fc2a49d..6e3721f 100644 --- a/doc/docs/zh/doc/language-basics/operator.md +++ b/doc/docs/zh/doc/language-basics/operator.md | |||
| @@ -138,6 +138,8 @@ tbA[] = ...tbB | |||
| 138 | 138 | ||
| 139 |   你可以使用前置 `...` 操作符在 Lua 表中插入数组表或哈希表。 | 139 |   你可以使用前置 `...` 操作符在 Lua 表中插入数组表或哈希表。 |
| 140 | 140 | ||
| 141 |   使用花括号字面量做表扩展(例如 `{...other}`)时,会复制 Lua 表中的数组部分和哈希部分。 | ||
| 142 | |||
| 141 | ```yuescript | 143 | ```yuescript |
| 142 | parts = | 144 | parts = |
| 143 | * "shoulders" | 145 | * "shoulders" |
| @@ -176,6 +178,30 @@ merge = {...a, ...b} | |||
| 176 | 178 | ||
| 177 | </YueDisplay> | 179 | </YueDisplay> |
| 178 | 180 | ||
| 181 | ### 列表表扩展 | ||
| 182 | |||
| 183 |   使用中括号字面量做表扩展(例如 `[...other,]`)时,只会复制 Lua 表中的数组部分。 | ||
| 184 | |||
| 185 | ```yuescript | ||
| 186 | source = {1, 2, 3, name: "Yue"} | ||
| 187 | fullCopy = {...source} | ||
| 188 | listCopy = [...source,] | ||
| 189 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 190 | -- listCopy => [1, 2, 3] | ||
| 191 | ``` | ||
| 192 | |||
| 193 | <YueDisplay> | ||
| 194 | |||
| 195 | ```yue | ||
| 196 | source = {1, 2, 3, name: "Yue"} | ||
| 197 | fullCopy = {...source} | ||
| 198 | listCopy = [...source,] | ||
| 199 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 200 | -- listCopy => [1, 2, 3] | ||
| 201 | ``` | ||
| 202 | |||
| 203 | </YueDisplay> | ||
| 204 | |||
| 179 | ## 表反向索引 | 205 | ## 表反向索引 |
| 180 | 206 | ||
| 181 |   你可以使用 **#** 操作符来反向索引表中的元素。 | 207 |   你可以使用 **#** 操作符来反向索引表中的元素。 |
diff --git a/doc/yue-de.md b/doc/yue-de.md index aeaabf1..f0979e0 100644 --- a/doc/yue-de.md +++ b/doc/yue-de.md | |||
| @@ -2217,6 +2217,8 @@ tbA[] = ...tbB | |||
| 2217 | 2217 | ||
| 2218 | Du kannst Array-Tabellen oder Hash-Tabellen mit dem Spread-Operator `...` vor Ausdrücken in Tabellenliteralen zusammenführen. | 2218 | Du kannst Array-Tabellen oder Hash-Tabellen mit dem Spread-Operator `...` vor Ausdrücken in Tabellenliteralen zusammenführen. |
| 2219 | 2219 | ||
| 2220 | Wenn in ein Tabellenliteral mit geschweiften Klammern gespreadet wird (zum Beispiel `{...other}`), werden sowohl der Array-Teil als auch der Hash-Teil der Lua-Tabelle kopiert. | ||
| 2221 | |||
| 2220 | ```yuescript | 2222 | ```yuescript |
| 2221 | parts = | 2223 | parts = |
| 2222 | * "Schultern" | 2224 | * "Schultern" |
| @@ -2234,6 +2236,18 @@ b = {4, 5, y: 1} | |||
| 2234 | merge = {...a, ...b} | 2236 | merge = {...a, ...b} |
| 2235 | ``` | 2237 | ``` |
| 2236 | 2238 | ||
| 2239 | ### List-Tabellen-Spread | ||
| 2240 | |||
| 2241 | Wenn in ein Tabellenliteral mit eckigen Klammern gespreadet wird (zum Beispiel `[...other,]`), wird nur der Array-Teil kopiert. | ||
| 2242 | |||
| 2243 | ```yuescript | ||
| 2244 | source = {1, 2, 3, name: "Yue"} | ||
| 2245 | fullCopy = {...source} | ||
| 2246 | listCopy = [...source,] | ||
| 2247 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 2248 | -- listCopy => [1, 2, 3] | ||
| 2249 | ``` | ||
| 2250 | |||
| 2237 | ## Umgekehrter Tabellenindex | 2251 | ## Umgekehrter Tabellenindex |
| 2238 | 2252 | ||
| 2239 | Mit dem Operator **#** kannst du auf die letzten Elemente einer Tabelle zugreifen. | 2253 | Mit dem Operator **#** kannst du auf die letzten Elemente einer Tabelle zugreifen. |
diff --git a/doc/yue-en.md b/doc/yue-en.md index 2cac78a..6680281 100644 --- a/doc/yue-en.md +++ b/doc/yue-en.md | |||
| @@ -2219,6 +2219,8 @@ tbA[] = ...tbB | |||
| 2219 | 2219 | ||
| 2220 | You can concatenate array tables or hash tables using spread operator `...` before expressions in table literals. | 2220 | You can concatenate array tables or hash tables using spread operator `...` before expressions in table literals. |
| 2221 | 2221 | ||
| 2222 | When spreading into a brace table literal (for example, `{...other}`), both the array part and hash part of the Lua table are copied. | ||
| 2223 | |||
| 2222 | ```yuescript | 2224 | ```yuescript |
| 2223 | parts = | 2225 | parts = |
| 2224 | * "shoulders" | 2226 | * "shoulders" |
| @@ -2236,6 +2238,18 @@ b = {4, 5, y: 1} | |||
| 2236 | merge = {...a, ...b} | 2238 | merge = {...a, ...b} |
| 2237 | ``` | 2239 | ``` |
| 2238 | 2240 | ||
| 2241 | ### List Table Spreading | ||
| 2242 | |||
| 2243 | When spreading into a bracket table literal (for example, `[...other,]`), only the array part is copied. | ||
| 2244 | |||
| 2245 | ```yuescript | ||
| 2246 | source = {1, 2, 3, name: "Yue"} | ||
| 2247 | fullCopy = {...source} | ||
| 2248 | listCopy = [...source,] | ||
| 2249 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 2250 | -- listCopy => [1, 2, 3] | ||
| 2251 | ``` | ||
| 2252 | |||
| 2239 | ## Table Reversed Indexing | 2253 | ## Table Reversed Indexing |
| 2240 | 2254 | ||
| 2241 | You can use the **#** operator to get the last elements of a table. | 2255 | You can use the **#** operator to get the last elements of a table. |
diff --git a/doc/yue-id-id.md b/doc/yue-id-id.md index 73bf1bb..863e187 100644 --- a/doc/yue-id-id.md +++ b/doc/yue-id-id.md | |||
| @@ -2215,6 +2215,8 @@ tbA[] = ...tbB | |||
| 2215 | 2215 | ||
| 2216 | Anda bisa menggabungkan tabel array atau tabel hash menggunakan operator spread `...` sebelum ekspresi di literal tabel. | 2216 | Anda bisa menggabungkan tabel array atau tabel hash menggunakan operator spread `...` sebelum ekspresi di literal tabel. |
| 2217 | 2217 | ||
| 2218 | Saat melakukan spread ke literal tabel dengan kurung kurawal (misalnya `{...other}`), bagian array dan bagian hash dari tabel Lua akan disalin. | ||
| 2219 | |||
| 2218 | ```yuescript | 2220 | ```yuescript |
| 2219 | parts = | 2221 | parts = |
| 2220 | * "shoulders" | 2222 | * "shoulders" |
| @@ -2232,6 +2234,18 @@ b = {4, 5, y: 1} | |||
| 2232 | merge = {...a, ...b} | 2234 | merge = {...a, ...b} |
| 2233 | ``` | 2235 | ``` |
| 2234 | 2236 | ||
| 2237 | ### Penyebaran Tabel List | ||
| 2238 | |||
| 2239 | Saat melakukan spread ke literal tabel dengan kurung siku (misalnya `[...other,]`), hanya bagian array yang disalin. | ||
| 2240 | |||
| 2241 | ```yuescript | ||
| 2242 | source = {1, 2, 3, name: "Yue"} | ||
| 2243 | fullCopy = {...source} | ||
| 2244 | listCopy = [...source,] | ||
| 2245 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 2246 | -- listCopy => [1, 2, 3] | ||
| 2247 | ``` | ||
| 2248 | |||
| 2235 | ## Indeks Balik Tabel | 2249 | ## Indeks Balik Tabel |
| 2236 | 2250 | ||
| 2237 | Anda dapat menggunakan operator **#** untuk mendapatkan elemen terakhir dari tabel. | 2251 | Anda dapat menggunakan operator **#** untuk mendapatkan elemen terakhir dari tabel. |
diff --git a/doc/yue-pt-br.md b/doc/yue-pt-br.md index d48c19b..a1408c2 100644 --- a/doc/yue-pt-br.md +++ b/doc/yue-pt-br.md | |||
| @@ -2217,6 +2217,8 @@ tbA[] = ...tbB | |||
| 2217 | 2217 | ||
| 2218 | Você pode concatenar tabelas de array ou tabelas hash usando o operador spread `...` antes de expressões em literais de tabela. | 2218 | Você pode concatenar tabelas de array ou tabelas hash usando o operador spread `...` antes de expressões em literais de tabela. |
| 2219 | 2219 | ||
| 2220 | Ao fazer spread em um literal de tabela com chaves (por exemplo, `{...other}`), tanto a parte de array quanto a parte hash da tabela Lua são copiadas. | ||
| 2221 | |||
| 2220 | ```yuescript | 2222 | ```yuescript |
| 2221 | parts = | 2223 | parts = |
| 2222 | * "shoulders" | 2224 | * "shoulders" |
| @@ -2234,6 +2236,18 @@ b = {4, 5, y: 1} | |||
| 2234 | merge = {...a, ...b} | 2236 | merge = {...a, ...b} |
| 2235 | ``` | 2237 | ``` |
| 2236 | 2238 | ||
| 2239 | ### Spread de tabela de lista | ||
| 2240 | |||
| 2241 | Ao fazer spread em um literal de tabela com colchetes (por exemplo, `[...other,]`), apenas a parte de array é copiada. | ||
| 2242 | |||
| 2243 | ```yuescript | ||
| 2244 | source = {1, 2, 3, name: "Yue"} | ||
| 2245 | fullCopy = {...source} | ||
| 2246 | listCopy = [...source,] | ||
| 2247 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 2248 | -- listCopy => [1, 2, 3] | ||
| 2249 | ``` | ||
| 2250 | |||
| 2237 | ## Indexação reversa de tabela | 2251 | ## Indexação reversa de tabela |
| 2238 | 2252 | ||
| 2239 | Você pode usar o operador **#** para obter os últimos elementos de uma tabela. | 2253 | Você pode usar o operador **#** para obter os últimos elementos de uma tabela. |
diff --git a/doc/yue-zh.md b/doc/yue-zh.md index dfc5996..ac7e4b2 100644 --- a/doc/yue-zh.md +++ b/doc/yue-zh.md | |||
| @@ -2207,6 +2207,8 @@ tbA[] = ...tbB | |||
| 2207 | 2207 | ||
| 2208 |   你可以使用前置 `...` 操作符在 Lua 表中插入数组表或哈希表。 | 2208 |   你可以使用前置 `...` 操作符在 Lua 表中插入数组表或哈希表。 |
| 2209 | 2209 | ||
| 2210 |   使用花括号字面量做表扩展(例如 `{...other}`)时,会复制 Lua 表中的数组部分和哈希部分。 | ||
| 2211 | |||
| 2210 | ```yuescript | 2212 | ```yuescript |
| 2211 | parts = | 2213 | parts = |
| 2212 | * "shoulders" | 2214 | * "shoulders" |
| @@ -2224,6 +2226,18 @@ b = {4, 5, y: 1} | |||
| 2224 | merge = {...a, ...b} | 2226 | merge = {...a, ...b} |
| 2225 | ``` | 2227 | ``` |
| 2226 | 2228 | ||
| 2229 | ### 列表表扩展 | ||
| 2230 | |||
| 2231 |   使用中括号字面量做表扩展(例如 `[...other,]`)时,只会复制 Lua 表中的数组部分。 | ||
| 2232 | |||
| 2233 | ```yuescript | ||
| 2234 | source = {1, 2, 3, name: "Yue"} | ||
| 2235 | fullCopy = {...source} | ||
| 2236 | listCopy = [...source,] | ||
| 2237 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 2238 | -- listCopy => [1, 2, 3] | ||
| 2239 | ``` | ||
| 2240 | |||
| 2227 | ## 表反向索引 | 2241 | ## 表反向索引 |
| 2228 | 2242 | ||
| 2229 |   你可以使用 **#** 操作符来反向索引表中的元素。 | 2243 |   你可以使用 **#** 操作符来反向索引表中的元素。 |
