Skip to content

Commit f7fdcba

Browse files
authored
Fix typo and improve description (#19)
1 parent 03bacb0 commit f7fdcba

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/basic/scripting-literal-and-variable.typ

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -738,9 +738,9 @@ Typst提供了一系列「成员」和「方法」访问字面量、变量与函
738738
#g([一个俩个], [仨个四个], [五六七八个])
739739
```)
740740

741-
```typc args.pos()```的类型是`Argument`
742-
+ 使用`args.pos()`得到按顺序传入的参数
743-
+ 使用`args.at(name)`访问名称为`name`的具名参数。
741+
```typc args```的类型是`arguments`
742+
+ 使用`args.pos()`得到传入的位置参数数组;使用`args.named()`得到传入的具名参数字典。
743+
+ 使用`args.at(i)`访问索引为整数`i`的位置参数;使用`args.at(name)`访问名称为字符串`name`的具名参数。
744744

745745
=== 参数解构 <grammar-destructing-param>
746746

@@ -804,7 +804,7 @@ todo参数解构。
804804
#let c = [江]
805805
#let f(x, y) = a + x + a + y
806806
#let g(x, y, z, u, v) = [#f(x, y + a + z),#f(u, v)。]
807-
#g([帆], [], [#(b)舟], [个#(b)翁], [钓钩]) \
807+
#g([帆], [], [#(b)舟], [个#(b)翁], [钓钩]) \
808808
#g([俯], [仰], [场笑], [#(c)明月], [#(c)秋])
809809
````
810810

@@ -837,7 +837,7 @@ todo参数解构。
837837
#let q1 = ````typ
838838
#set align(center)
839839
#let matrix-fmt(..args) = table(
840-
columns: args.pos().at(0).len(),
840+
columns: args.at(0).len(),
841841
..args.pos().flatten().flatten().map(str)
842842
)
843843
#matrix-fmt(

0 commit comments

Comments
 (0)