Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Scala

Scala Language
by

Choucri Fahed

on 17 June 2009

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Scala

Scala
A Scalable Language
Overview
Object Oriented
Functional
Created at EPFL by Martin Odersky in 2003
Used by Twitter, Siemens, SAP, EDF...
Compiles to Java bytecode and runs on top of the JVM
Clever static typing
Everything is an object
2 > 1 <=> 2.>(1)
map containsKey 'a' <=> map.containsKey('a')
map should have key ('a')
No static members but singleton objects
object HelloWorld {
def main(args: Array[String]) {
println("Hello, world!")
}
}
Single class inheritance, multiple trait inheritance
Functions are 1st class citizens
All functions are values
Anonymous functions
Higher order functions
Currying...
Functional Pogramming encourages
'Final' variables
Immutable objects
Transformation of data structures
Functions with no side effects
boolean nameHasUpperCase = false;
for (int i = 0; i < name.length(); ++i) {
if (Character.isUpperCase(name.charAt(i))) {
nameHasUpperCase = true;
break;
}
}
final boolean nameHasUpperCase =
!name.toLowerCase().equals(name);
Java
val nameHasUpperCase = name.exists(_.isUpperCase)
Scala
List(1,2,3,4) map (_ * 2) foreach println
Full transcript