Sorting by static objects in Slick


Sorting by static objects in Slick
http://ift.tt/2BLA2uD

Submitted February 23, 2018 at 08:01PM by Jdrphillips-scala
via reddit http://ift.tt/2Ce7afH

Advertisements

Scala Quiz: Unary Precedence


Scala Quiz: Unary Precedence

Without tesing with a repl, can you correctly guess all the ???.

val a = 1 implicit class RichInt(val x: Int) { def s: Int = { println(s"got x = $x") 2 } } /* Expression | Print | Returns -----------|------------|--------- -(1.s) | ??? | ??? -(a.s) | ??? | ??? -a.s | ??? | ??? -1.s | ??? | ??? */ implicit class RichInt2(val x: Int) { def s: String = { println(s"got x = $x") s"returning x = $x" } } /* Expression | Compiles | Print | Returns -----------|----------|------------|--------- -(1.s) | ??? | ??? | ??? -(a.s) | ??? | ??? | ??? -a.s | ??? | ??? | ??? -1.s | ??? | ??? | ??? */ 

Submitted February 21, 2018 at 11:39PM by MasGui
via reddit http://ift.tt/2CbT8v4