From 394ee0f64a0dc022f1dab86213d4771982ecf987 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Sat, 28 Feb 2026 16:52:40 +0800 Subject: Updated docs. --- doc/docs/de/doc/language-basics/operator.md | 26 ++++++++++++++++++++++++++ doc/docs/doc/language-basics/operator.md | 26 ++++++++++++++++++++++++++ doc/docs/id-id/doc/language-basics/operator.md | 26 ++++++++++++++++++++++++++ doc/docs/pt-br/doc/language-basics/operator.md | 26 ++++++++++++++++++++++++++ doc/docs/zh/doc/language-basics/operator.md | 26 ++++++++++++++++++++++++++ doc/yue-de.md | 14 ++++++++++++++ doc/yue-en.md | 14 ++++++++++++++ doc/yue-id-id.md | 14 ++++++++++++++ doc/yue-pt-br.md | 14 ++++++++++++++ doc/yue-zh.md | 14 ++++++++++++++ 10 files changed, 200 insertions(+) (limited to 'doc') 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 Du kannst Array-Tabellen oder Hash-Tabellen mit dem Spread-Operator `...` vor Ausdrücken in Tabellenliteralen zusammenführen. +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. + ```yuescript parts = * "Schultern" @@ -176,6 +178,30 @@ merge = {...a, ...b} +### List-Tabellen-Spread + +Wenn in ein Tabellenliteral mit eckigen Klammern gespreadet wird (zum Beispiel `[...other,]`), wird nur der Array-Teil kopiert. + +```yuescript +source = {1, 2, 3, name: "Yue"} +fullCopy = {...source} +listCopy = [...source,] +-- fullCopy => {1, 2, 3, name: "Yue"} +-- listCopy => [1, 2, 3] +``` + + + +```yue +source = {1, 2, 3, name: "Yue"} +fullCopy = {...source} +listCopy = [...source,] +-- fullCopy => {1, 2, 3, name: "Yue"} +-- listCopy => [1, 2, 3] +``` + + + ## Umgekehrter Tabellenindex 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 You can concatenate array tables or hash tables using spread operator `...` before expressions in table literals. +When spreading into a brace table literal (for example, `{...other}`), both the array part and hash part of the Lua table are copied. + ```yuescript parts = * "shoulders" @@ -176,6 +178,30 @@ merge = {...a, ...b} +### List Table Spreading + +When spreading into a bracket table literal (for example, `[...other,]`), only the array part is copied. + +```yuescript +source = {1, 2, 3, name: "Yue"} +fullCopy = {...source} +listCopy = [...source,] +-- fullCopy => {1, 2, 3, name: "Yue"} +-- listCopy => [1, 2, 3] +``` + + + +```yue +source = {1, 2, 3, name: "Yue"} +fullCopy = {...source} +listCopy = [...source,] +-- fullCopy => {1, 2, 3, name: "Yue"} +-- listCopy => [1, 2, 3] +``` + + + ## Table Reversed Indexing 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 Anda bisa menggabungkan tabel array atau tabel hash menggunakan operator spread `...` sebelum ekspresi di literal tabel. +Saat melakukan spread ke literal tabel dengan kurung kurawal (misalnya `{...other}`), bagian array dan bagian hash dari tabel Lua akan disalin. + ```yuescript parts = * "shoulders" @@ -176,6 +178,30 @@ merge = {...a, ...b} +### Penyebaran Tabel List + +Saat melakukan spread ke literal tabel dengan kurung siku (misalnya `[...other,]`), hanya bagian array yang disalin. + +```yuescript +source = {1, 2, 3, name: "Yue"} +fullCopy = {...source} +listCopy = [...source,] +-- fullCopy => {1, 2, 3, name: "Yue"} +-- listCopy => [1, 2, 3] +``` + + + +```yue +source = {1, 2, 3, name: "Yue"} +fullCopy = {...source} +listCopy = [...source,] +-- fullCopy => {1, 2, 3, name: "Yue"} +-- listCopy => [1, 2, 3] +``` + + + ## Indeks Balik Tabel 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 Você pode concatenar tabelas de array ou tabelas hash usando o operador spread `...` antes de expressões em literais de tabela. +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. + ```yuescript parts = * "shoulders" @@ -176,6 +178,30 @@ merge = {...a, ...b} +### Spread de tabela de lista + +Ao fazer spread em um literal de tabela com colchetes (por exemplo, `[...other,]`), apenas a parte de array é copiada. + +```yuescript +source = {1, 2, 3, name: "Yue"} +fullCopy = {...source} +listCopy = [...source,] +-- fullCopy => {1, 2, 3, name: "Yue"} +-- listCopy => [1, 2, 3] +``` + + + +```yue +source = {1, 2, 3, name: "Yue"} +fullCopy = {...source} +listCopy = [...source,] +-- fullCopy => {1, 2, 3, name: "Yue"} +-- listCopy => [1, 2, 3] +``` + + + ## Indexação reversa de tabela 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   你可以使用前置 `...` 操作符在 Lua 表中插入数组表或哈希表。 +  使用花括号字面量做表扩展(例如 `{...other}`)时,会复制 Lua 表中的数组部分和哈希部分。 + ```yuescript parts = * "shoulders" @@ -176,6 +178,30 @@ merge = {...a, ...b} +### 列表表扩展 + +  使用中括号字面量做表扩展(例如 `[...other,]`)时,只会复制 Lua 表中的数组部分。 + +```yuescript +source = {1, 2, 3, name: "Yue"} +fullCopy = {...source} +listCopy = [...source,] +-- fullCopy => {1, 2, 3, name: "Yue"} +-- listCopy => [1, 2, 3] +``` + + + +```yue +source = {1, 2, 3, name: "Yue"} +fullCopy = {...source} +listCopy = [...source,] +-- fullCopy => {1, 2, 3, name: "Yue"} +-- listCopy => [1, 2, 3] +``` + + + ## 表反向索引   你可以使用 **#** 操作符来反向索引表中的元素。 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 Du kannst Array-Tabellen oder Hash-Tabellen mit dem Spread-Operator `...` vor Ausdrücken in Tabellenliteralen zusammenführen. +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. + ```yuescript parts = * "Schultern" @@ -2234,6 +2236,18 @@ b = {4, 5, y: 1} merge = {...a, ...b} ``` +### List-Tabellen-Spread + +Wenn in ein Tabellenliteral mit eckigen Klammern gespreadet wird (zum Beispiel `[...other,]`), wird nur der Array-Teil kopiert. + +```yuescript +source = {1, 2, 3, name: "Yue"} +fullCopy = {...source} +listCopy = [...source,] +-- fullCopy => {1, 2, 3, name: "Yue"} +-- listCopy => [1, 2, 3] +``` + ## Umgekehrter Tabellenindex 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 You can concatenate array tables or hash tables using spread operator `...` before expressions in table literals. +When spreading into a brace table literal (for example, `{...other}`), both the array part and hash part of the Lua table are copied. + ```yuescript parts = * "shoulders" @@ -2236,6 +2238,18 @@ b = {4, 5, y: 1} merge = {...a, ...b} ``` +### List Table Spreading + +When spreading into a bracket table literal (for example, `[...other,]`), only the array part is copied. + +```yuescript +source = {1, 2, 3, name: "Yue"} +fullCopy = {...source} +listCopy = [...source,] +-- fullCopy => {1, 2, 3, name: "Yue"} +-- listCopy => [1, 2, 3] +``` + ## Table Reversed Indexing 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 Anda bisa menggabungkan tabel array atau tabel hash menggunakan operator spread `...` sebelum ekspresi di literal tabel. +Saat melakukan spread ke literal tabel dengan kurung kurawal (misalnya `{...other}`), bagian array dan bagian hash dari tabel Lua akan disalin. + ```yuescript parts = * "shoulders" @@ -2232,6 +2234,18 @@ b = {4, 5, y: 1} merge = {...a, ...b} ``` +### Penyebaran Tabel List + +Saat melakukan spread ke literal tabel dengan kurung siku (misalnya `[...other,]`), hanya bagian array yang disalin. + +```yuescript +source = {1, 2, 3, name: "Yue"} +fullCopy = {...source} +listCopy = [...source,] +-- fullCopy => {1, 2, 3, name: "Yue"} +-- listCopy => [1, 2, 3] +``` + ## Indeks Balik Tabel 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 Você pode concatenar tabelas de array ou tabelas hash usando o operador spread `...` antes de expressões em literais de tabela. +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. + ```yuescript parts = * "shoulders" @@ -2234,6 +2236,18 @@ b = {4, 5, y: 1} merge = {...a, ...b} ``` +### Spread de tabela de lista + +Ao fazer spread em um literal de tabela com colchetes (por exemplo, `[...other,]`), apenas a parte de array é copiada. + +```yuescript +source = {1, 2, 3, name: "Yue"} +fullCopy = {...source} +listCopy = [...source,] +-- fullCopy => {1, 2, 3, name: "Yue"} +-- listCopy => [1, 2, 3] +``` + ## Indexação reversa de tabela 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   你可以使用前置 `...` 操作符在 Lua 表中插入数组表或哈希表。 +  使用花括号字面量做表扩展(例如 `{...other}`)时,会复制 Lua 表中的数组部分和哈希部分。 + ```yuescript parts = * "shoulders" @@ -2224,6 +2226,18 @@ b = {4, 5, y: 1} merge = {...a, ...b} ``` +### 列表表扩展 + +  使用中括号字面量做表扩展(例如 `[...other,]`)时,只会复制 Lua 表中的数组部分。 + +```yuescript +source = {1, 2, 3, name: "Yue"} +fullCopy = {...source} +listCopy = [...source,] +-- fullCopy => {1, 2, 3, name: "Yue"} +-- listCopy => [1, 2, 3] +``` + ## 表反向索引   你可以使用 **#** 操作符来反向索引表中的元素。 -- cgit v1.2.3-55-g6feb