scalacheat icon indicating copy to clipboard operation
scalacheat copied to clipboard

cheat sheet for scala syntax

Results 4 scalacheat issues
Sort by recently updated
recently updated
newest added

val n = sum(args:_*) Reference http://stackoverflow.com/a/1832288

When trying the listed example I get an error: ``` scala scala> (1 to 5).map { val x=_*2; println(x); x } :9: error: missing parameter type for expanded function ((x$1)...

I came across to this page while googling for `_*` in scala. Just leave a mark, and will send a pull request later. ``` f(xs: _*) // Sequence xs is...

``` scala scala> class C(private val x: Int) { def add(c: C) = x + c.x } ``` ``` defined class C ``` ``` scala scala> class C(x: Int) {...