Also - Play Framework (which I'm currently using) has got awesome Scala support (I see lot of answers and questions of Play and Scala on the Google groups).
I've read the primer..looks very interesting. Now to do code something concrete.
To download Scala (latest as of today) and install on Mac (Snow Leopard 10.8) is quite easy:
curl -O http://www.scala-lang.org/downloads/distrib/files/scala-2.9.1.final-installer.jarAfter it is downloaded, execute the below command
java -jar scala-2.9.1.final-installer.jarI installed scala at this location
~/scalaAdd the executable to the path.
vim .profile(or to the bash profile i.e. vim .bash_profile)
# append or add to the PATH variable ~/scala/bin
export PATH=$PATH:~/scala/bin
Open a terminal and type scala and you should see the below output
Welcome to Scala version 2.9.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26).Try the below example:
Type in expressions to have them evaluated.
Type :help for more information.
scala>
scala> val numbers = Map(1 -> "one", 2 -> "two")To quit the interpreter, just type quit.
numbers: scala.collection.immutable.Map[Int,java.lang.String] = Map(1 -> one, 2 -> two)
scala> numbers.get(2)
res0: Option[java.lang.String] = Some(two)
scala> numbers.get(3)
res1: Option[java.lang.String] = None
To begin - here is the awesome link on Learning Scala for beginners.
I also installed Scala Eclipse IDE - a plugin for Scala development on Eclipse.
Until next time...
Comments Section
Feel free to comment on the post but keep it clean and on topic.
blog comments powered by Disqus