Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Scala's worksheet, clarification needed [closed]

The following snippet compiles and runs fine

enter image description here

When using as part of worksheet, i see error

enter image description here

Why is this please?

like image 240
James Raitsev Avatar asked Mar 14 '26 05:03

James Raitsev


1 Answers

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)
like image 61
Ivan Meredith Avatar answered Mar 17 '26 04:03

Ivan Meredith



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!