News for hackers. Stuff that matters.
Re:Scala One Liners by msmith on Thursday June 02, 2011 @12:02AM (#2610621)
It's calling the fromFile method on the io.Source object. Package names are lower-case by convention, class and object names are capitalized camel-case, and methods are lower-case camel-case.

Also, 1.upto(10) can also be written as (1..10) in ruby

Re:Scala One Liners by carey on Thursday June 02, 2011 @12:16AM (#2610658)
By the way, it is possible to have methods and values on the package itself, like math.sin(math.Pi), but that hasn't been done with scala.io.

You can also import singleton methods, so if you write

  import io.Source._
then all the fromX methods are available directly.