read eval print loop - How do I access scala documentation from the repl? -


first of built in docs, , own code.

specifically, want information similar how in python can call help() on method or object information on object printed repl.

scaladocs generated html, don't want them appearing in repl window. might want load docs in browser repl, however. can creating own method (this 1 takes instance; have take instance of class[a] instead, if prefer):

def viewdoc[a](a: a) {   val name = a.asinstanceof[anyref].getclass.getname   val url = "http://www.scala-lang.org/api/current/index.html#"+name   val pb = new processbuilder("firefox",url)   val p = pb.start   p.waitfor } 

if want extra-clever, parse name point web browser @ javadocs java classes , scaladocs scala classes , wherever have documentation classes. want use local source, file:///my/path/to/docs/index.html# instead of api web. used can try out

scala> viewdoc(some(1)) 

Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -