In Scala, is there any difference at all between Nil and List()?
Nil
List()
If not, which one is more idiomatic Scala style? Both for creating new emp
scala> println (Nil == List()) true scala> println (Nil eq List()) true scala> println (Nil equals List()) true scala> System.identityHashCode(Nil) 374527572 scala> System.identityHashCode(List()) 374527572
Nil is more idiomatic and can be preferred in most cases. Questions?