8
在阅读play框架的scala文档(Play Docs)时,我看到了一种我从未见过的语法。什么是List [String〜Int]?
val populations:List[String~Int] = {
SQL("select * from Country").as(str("name") ~ int("population") *)
}
可能有人请告诉我这是什么“〜”在List[String~Int]
是什么意思?
哇!那很快。谢谢,这个例子有所帮助。 – rahul 2012-04-13 07:51:37
不客气。顺便说一句,你可以接受答案,如果它符合你的需要。 ;) – Nicolas 2012-04-13 07:53:45
其实,它不是一个Play类。它来自Scala标准库(特别是解析器组合器库)。这是[scaladoc](http://www.scala-lang.org/api/current/index.html#scala.util.parsing.combinator.Parsers$$tilde)。 – 2012-04-13 09:23:05