For example, when the actual value or the expression is a node-set, the final Boolean result is known as soon as a single member of the node-set is found.
例如,当实际值或表达式是一个节点集时,一旦找到节点集的一个成员时,就可以立即知道最终的布尔值结果。
The arguments above specify an expression that yields a boolean value and a block of code that returns nothing (Unit), which is exactly what while expects.
上述语句指定了一个表达式,该表达式产生了一个布尔值和一个不返回任何结果的代码块(Unit),这正是 while 所期望的。
Up to this point, you've seen how the if statement can be used to execute one of two blocks of program statements, depending on the value of a particular Boolean expression.
至此,已经看到了if语句可以如何用于根据一个特定布尔表达式的值,来执行两个程序语句块中的其中一个。
应用推荐