以下是 Play Framework 源代码的一部分:
package play.api.mvc
trait Results extends java.lang.Object {
def $init$() : scala.Unit = { /* compiled code */ }
def Async(promise : scala.concurrent.Future[play.api.mvc.Result]) : play.api.mvc.AsyncResult = { /* compiled code */ }
val Ok : Results.this.Status = { /* compiled code */ }
val Created : Results.this.Status = { /* compiled code */ }
val Accepted : Results.this.Status = { /* compiled code */ }
//.......................
我想知道,为什么他们命名val
并def
以大写字母开头?
此外,一些类和对象以小写字母开头:
package views.html.play20
object book extends BaseScalaTemplate[play.api.templates.Html, play.templates.Format[play.api.templates.Html]] with play.api.templates.Template1[scala.Seq[scala.Predef.String], play.api.templates.Html] {
def apply(pages : scala.Seq[scala.Predef.String]) : play.api.templates.Html = { /* compiled code */ }
//.............
}
package views.html.play20
object manual extends play.templates.BaseScalaTemplate[play.api.templates.Html, play.templates.Format[play.api.templates.Html]] with play.api.templates.Template3[scala.Predef.String, scala.Option[scala.Predef.String], scala.Option[scala.Predef.String], play.api.templates.Html] {
def apply(title : scala.Predef.String, main : scala.Option[scala.Predef.String], sidebar : scala.Option[scala.Predef.String]) : play.api.templates.Html = { /* compiled code */ }
//............
}
package views
package object xml extends java.lang.Object {
}