本文旨在介紹Scala在其他語言中不太常見的符號含義,幫助理解Scala Code。
隨著我對Scala學習的深入,我會不斷增加該篇博文的內容,下面介紹Scala中的符號:
val one = List(1,2,3) val two = List(4,5,6) val three = one:::two
輸出結果為:three: List[Int] = List(1, 2, 3, 4, 5, 6)
val four = one -> two
返回:(List[Int], List[Int]) = (List(1, 2, 3),List(4, 5, 6))
參考文獻
1 http://stackoverflow.com/questions/6951895/what-does-and-mean-in-scala
2 http://docs.scala-lang.org/tutorials/FAQ/finding-symbols.html