I\'m learning Scala at the moment (Programming Scala, 2nd Edition, Odersky).
When building a list using the cons operator we have to write:
val l = 1
Actually, you can make it work yourself:
scala> implicit class Listable[A](val value: A) {
| def ::[B >: A](other: B): List[B] = other :: value :: Nil
| }
defined class Listable
scala> val xs = 1 :: 2 :: 3 :: 4
xs: List[Int] = List(1, 2, 3, 4)
scala> val ys = "A" :: "B" :: "C"
ys: List[String] = List(A, B, C)
scala>