The Unit Type
Inspect one language lane at a time so line-level text and code deltas stay readable.
Diff Lane
English
0 modified sections0 code block delta0 anchor delta
Diff Lane
中文
1 modified sections0 code block delta0 anchor delta
modifiedUnit 类型text+1 line, -1 line
v1.0.5
Section Text
1
对于那些只关心副作用而不关心值的表达式,它们的类型是 `Unit`。例如,`print` 函数、赋值表达式、复合赋值表达式、自增和自减表达式、循环表达式,它们的类型都是 `Unit`。2
3
`Unit` 类型只有一个值,也是它的字面量:`()`。除了赋值、判等和判不等外,`Unit` 类型不支持其他操作。v1.1.0
Section Text
1
对于那些只关心副作用而不关心值的表达式,它们的类型是 `Unit`。例如`print` 函数、赋值表达式、复合赋值表达式、自增和自减表达式、循环表达式,它们的类型都是 `Unit`。2
3
`Unit` 类型只有一个值,也是它的字面量:`()`。除了赋值、判等和判不等外,`Unit` 类型不支持其他操作。