返回语句在Scala中是可选的。
最后要注意没有返回语句。
在这些情况下,脚本以值或返回语句结束。
In these cases, the script ends with a value or a return statement.
这里没有返回语句。
你的返回语句不返回任何东西。
该插件解析器的实现函数的大部分是有一个简单的返回语句组成的。
Most of this plug-in parser's implementation functions consist of a simple return statement.
一个有返回值的方法必须包含一条返回语句指明返回结果。
A method that returns a value must have a return statement that specifies the result.
你是否曾试图修改过一些在方法里到处都是返回语句的程序代码?
Have you ever tried to troubleshoot some code that has return statements thrown around all over the method?
不需要为lambda函数提供返回类型;根据返回语句推导出返回类型。
On to the answers. You do not need to provide the return type of a lambda function; it is deduced from the return statement.
不幸的是,由于循环分支太接近返回语句,因此您无法预测循环分支和返回分支。
Unfortunately, because the loop branch is so close to the return statement, you cannot predict both the loop branch and the return branch.
在某些情况下,比如返回语句中,用元组来实现语法上要比列表简单很多。
In some contexts, like a return statement, it is syntactically simpler to create a tuple than a list.
返回语句:一种特殊的语句,功能是终止当前函数,立即跳出到函数调用者。
A statement that causes a function to end immediately and return to the caller.
一个有返回值的方法必须包含一条返回语句指明返回结果。方法可以返回任何类型的结果。
A method that returns a value must have a return statement that specifies the result. Methods may return values of any type.
返回语句我们之前已经遇到过了,但在有返回值的函数里面,返回语句可以包含表达式。
We have seen the return statement before, but in a fruitful function the return statement includes an expression.
在有返回值的函数里面,建议要确认一下每一种存在的可能,来让函数触发一个返回语句。
In a fruitful function, it is a good idea to ensure that every possible path through the program hits a return statement.
同样,在返回语句之前也不需要使用类似“Nowwereturnavalue”这样的注释。
And you don't need a comment before the return statement saying, "Now we return a value," either.
如果没有返回语句,将返回对方法的最后一个语句的求值(如果可行并且Scala没有返回编译错误的话)。
If there is no return statement, then the evaluation of the last statement in the method is returned (if it can be, if not Scala returns a compilation error.)
一般来讲,你可以用条件表达式来替换掉条件语句,无论这些语句的分支是返回语句或者是赋值语句。
In general, you can replace a conditional statement with a conditional expression if both branches contain simple expressions that are either returned or assigned to the same variable.
如果将返回值改为float,这不会被标记成错误,因为test方法返回语句中的int会自动转换成float。
Changing the return type to float, for example, isn't flagged as an error because an int in the test method's return statement is automatically promoted to float.
PUT命令会发回输出缓冲区的内容,但是main末尾的返回语句也会将数据发送回去;所生成的状态会发回给PPE。
The put command sends back the contents of the output buffer, but the return statement at the end of main also sends back data; the status generated will be passed back to the PPE.
另外,函数返回语句可以返回initializer _ list;但是,必须包含头文件initializer _ list才能使用这个类类型。
Also, function return statements are allowed to return initializer_list; however, you must include the header initializer_list to use this class type.
该语句返回与指定路径结构匹配的所有节点。
This statement returns all nodes that match the specified path structure.
两个语句返回的结果相同。
上面的查询语句返回与tax1120view视图所含内容相同的信息。
The query statement above returns the same information as contained in the TAX1120VIEW view.
注意:要检测循环,在检测循环时,系统只会检查迭代select语句返回的结果。
Note: To detect a cycle, only the results returned by the iterative SELECT statement are checked.
如果语句执行返回一个错误,过程将自动中断或回滚事务。
If statement execution returns an error, the procedure is automatically aborted or the transaction is rolled back.
select语句经常会返回多行数据。
select语句通常返回多行数据。
方法声明的返回类型表明sql语句的结果返回什么样的对象格式。
The return type of the method declaration indicates in what object format the results of the SQL statement will be returned.
方法声明的返回类型表明sql语句的结果返回什么样的对象格式。
The return type of the method declaration indicates in what object format the results of the SQL statement will be returned.
应用推荐