3 ms·
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 met
by msmith 15y ago
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
- carey 15y agoBy 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.