使用Scala的工作表,需要澄清[关闭](Using Scala's worksheet, clarification needed [closed])
以下代码段编译并运行正常
当作为工作表的一部分使用时,我看到错误
为什么这样好?
The following snippet compiles and runs fine
When using as part of worksheet, i see error
Why is this please?
最满意答案
这可能只是一个错误/缺失的功能。
顺便说一句,您可以像下面的代码一样编写joiner来获得相同的行为,它也将避免工作表问题。
def joiner(strings: List[String], separator: String = " ") = strings.mkString(separator)It's probably just a bug/missing feature.
By the way, you could write joiner like the following code to get the same behaviour, and it also will avoid the worksheet problem.
def joiner(strings: List[String], separator: String = " ") = strings.mkString(separator)更多推荐
发布评论