我是
Scala编程的新手,并且喜欢在eclipse之外的终端编码,因为它非常好.我找不到任何信息的一件事是如何检索Scala REPL上的api文件(即“scala”或“sbt”命令),如python或ipython响应在help()或放“?”分别在api的末尾.甚至Scala似乎也没有像
Python的“pydoc”或C语言的“man”那样的命令.
只有找到api文档的方法是通过浏览web表单的文件或者我错过了吗?
解决方法
Is it true that only way to find api document is by browsing document with web form or am I missing?
在这一点上确实如此.
我写了一个sbt插件sbt-man,但它的能力是有限的.
> man Traversable /: [man] scala.collection.Traversable [man] def /:[B](z: B)(op: (B ⇒ A ⇒ B)): B [man] Applies a binary operator to a start value and all elements of this collection,going left to right. Note: /: is alternate syntax for foldLeft; z /: xs is the same as xs foldLeft z. Note: will not terminate for infinite- sized collections. Note: might return different results for different runs,unless the underlying collection type is ordered. or the operator is associative and commutative.
为了便于下载,我还写了doctrine.
$doctrine "org.scala-lang" % "scala-library" % "2.11.2" -o ~/doc [info] unzippped documents to /Users/foo/doc/scala-library-2.11.2-javadoc