Sunday, September 13, 2009

Scala Syntax

Scala is a functional, object-oriented programming language that runs on the JVM. Scala is suited for multi-threaded, multi-processor development because it is quite simple to pass immutable messages between threads.

Scala is different. Any is the base class of all objects. None represents null or the empty set. Nothing, Nil, Null, Some, Option are classes in Scala's API. Before investigating the API, let's just clarify a little syntax, the difference between val and var. vals are simply values - immutable. vars are variables. Two ways to declare fields with immutability as the obvious difference.

Other reserved words in the Scala syntax are:

abstract
case
catch
class
def
do
else
extends
false
final
finally
for
forSome
if
implicit
import
lazy
match
new
null
object
override
package
private
protected
requires
return
sealed
super
this
throw
trait
try
true
type
val
var
while
with
yield
_
:
=
=>
<-
<:
<%
>:
#
@