[Scala Help] Learning Scala 09-19-2013, 08:09 AM
#1
Hello [username],
I started learning Scala yesterday. I have no depth and I know nothing in Scala at present. I am reading a book Programming in Scala by Martin Odersky (The creator of Scala) ,and lee Spoon. I am also taking an online course on Scala Programming on Coursera.org, Here is the course link : https://class.coursera.org/progfun-003/class
According to the instructions given there I have installed the sbt and I can run programs in the Scala interpreter. I am also using the eclipse IDE as directed on the site but I am facing a strange problem and I cannot run any Scala module. It has no build options or run file options. It just has Run Configuration. There is a system in eclipse of creating a worksheet and trying to run Scala codes there and it compiles and run every time I save the worksheet. But the problem is I cannot run the module. I have even installed the Scala plugin in netbeans but every time I try to run the module it says main class not found.
What I did is I created a Scala Object file and wrote the following code (I did as directed in the video lecture and I followed the similar steps):-
I have run the following code on the scala command line and it worked beautifully:-
I want to learn a functional language as well and so I thought Scala would best suit me as it has much similarity with Java (I mean we can use Java codes and its quite similar). It has similarity with JScript and python as well (It seemed to me atleast) and I decided to go with Scala.
I expect some help on how to overcome this situation. Please guide some steps on how to execute a file completely and if required by creating a main class as well.
Thank you,
Sincerely,
Psycho_Coder,
I started learning Scala yesterday. I have no depth and I know nothing in Scala at present. I am reading a book Programming in Scala by Martin Odersky (The creator of Scala) ,and lee Spoon. I am also taking an online course on Scala Programming on Coursera.org, Here is the course link : https://class.coursera.org/progfun-003/class
According to the instructions given there I have installed the sbt and I can run programs in the Scala interpreter. I am also using the eclipse IDE as directed on the site but I am facing a strange problem and I cannot run any Scala module. It has no build options or run file options. It just has Run Configuration. There is a system in eclipse of creating a worksheet and trying to run Scala codes there and it compiles and run every time I save the worksheet. But the problem is I cannot run the module. I have even installed the Scala plugin in netbeans but every time I try to run the module it says main class not found.
What I did is I created a Scala Object file and wrote the following code (I did as directed in the video lecture and I followed the similar steps):-
Code:
object Hello {
println("Hello")
}I have run the following code on the scala command line and it worked beautifully:-
Code:
val l=List(3,4,5) //> l : List[Int] = List(3, 4, 5)
val sq=l.map(x=>x*x) //> sq : List[Int] = List(9, 16, 25)
print(sq)I want to learn a functional language as well and so I thought Scala would best suit me as it has much similarity with Java (I mean we can use Java codes and its quite similar). It has similarity with JScript and python as well (It seemed to me atleast) and I decided to go with Scala.
I expect some help on how to overcome this situation. Please guide some steps on how to execute a file completely and if required by creating a main class as well.
Thank you,
Sincerely,
Psycho_Coder,
![[Image: OilyCostlyEwe.gif]](http://fat.gfycat.com/OilyCostlyEwe.gif)

![[+]](https://sinister.li/images/modern/collapse_collapsed.png)
![[Image: 2YpkRjy.png]](http://i.imgur.com/2YpkRjy.png)