Unformatted text preview:

CSE 5317Lecture 13: Scala14 Oct 2010Nate NystromUniversity of Texas at ArlingtonScala• Developed by Martin Odersky’s group at EPFL in Lausanne, CH, from 2003-present• Integrates OO and functional programming features• Runs on the JVM and on .NET• JVM better supported, though• Seamless integration with Java• Scala programs can use Java classes• Java programs can use Scala classesWhere to get it• Scala webpage:• http://www.scala-lang.org• Download: http://www.scala-lang.org/downloads• Scala Eclipse, NetBeans, IntelliJ plugins• http://www.scala-lang.org/node/91Where to learn more• Scala tutorials:• http://www.scala-lang.org/node/1305• http://www.artima.com/scalazine/articles/steps.html• Scala books:• Programming in Scala by Odersky, Spoon, and Venners• Programming Scala by Wampler and Payne• Free download from:• http://programming-scala.labs.oreilly.com/Scala compiler and interpreter• Compiler•scalac%foo.scala – compiles foo.scala to Java bytecode • Interpreter:•scala%foo.scala – compiles and runs foo.scala•run scala on the command-line to get a “shell”Features• Lightweight syntax• no ‘;’ required• def, val, var• method call: x.m vs. x.m()• Type inference• Usual imperative features: while, if, ...• Iteration: for, foreach• Minor gotchas: no C-style for loop, no x++ (use x += 1)• Pure OO• all values are objects including: Int, Boolean, Float, Array[Int], ...• all operations are methods: + is a method of Int, ...• Function types, arrays, lists, tuples, sets, maps• Singleton objects rather than static• Traits (interfaces with code)Where to go• ssh omega.uta.edu• ~nystrom/scala/bin/scala• ~nystrom/scala/bin/scalac• add to your .bash_profile•


View Full Document

UT Arlington CSE 5317 - Lecture Notes

Download Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?