I am new to Scala and have some question about why string::List() works List()::s doesn't?I also want to know if ListBuffer works better than ::?
val columnNames :List[String] = ['foo','bar']
val work :List[String] = List()
for (s <- columnNames) {
s match {
//this doesn't compile
//case workPattern => work :: s
//this works
case workPattern => s :: work
// this also works
case workPattern => work :: List(s)
}