Tentang FTI
Fakultas Teknik dan Informatika
Universitas Widya Gama Mahakam Samarinda
Jl. Wahid Hasyim II No. 28, Samarinda
Kalimantan Timur
Email: fti@uwgm.ac.id
Website: fti-uwgm.ac.id
Scala smoothly integrates object-oriented and functional programming. It is designed to express common programming patterns in a concise, elegant, and typesafe way. Scala introduces several innovative language constructs. For instance: • Abstracttypesandmixincompositionunifyconceptsfromobjectandmodule systems. • Pattern matching over class hierarchies unifies functional and objectoriented data access. It greatly simplifies the processing of XML trees. • A flexible syntax and type system enables the construction of advanced libraries and new domainspecificlanguages. At the same time, Scala is compatible with Java. Java libraries and frameworks can be usedwithout glue code oradditional declarations. This document introduces Scala in an informal way, through a sequence of examples. Chapters2and3highlightsomeofthefeaturesthatmakeScalainteresting. ThefollowingchaptersintroducethelanguageconstructsofScalainamorethoroughway, starting withsimpleexpressionsandfunctions,andworkingupthroughobjectsand classes, lists and streams, mutable state, pattern matching to more complete examples that show interesting programming techniques. The present informal exposition is meant to be complemented by the Scala Language Reference Manual which specifies Scala in a more detailed and precise way. Acknowledgment. We owe a great debt to Abelson’s and Sussman’s wonderful book “Structure and Interpretation of Computer Programs”[ASS96]. Many of their examples and exercises are also present here. Of course, the working language has in eachcasebeenchangedfromSchemetoScala. Furthermore,theexamplesmake use of Scala’s object-oriented constructs where appropriate.
Fakultas Teknik dan Informatika
Universitas Widya Gama Mahakam Samarinda
Jl. Wahid Hasyim II No. 28, Samarinda
Kalimantan Timur
Email: fti@uwgm.ac.id
Website: fti-uwgm.ac.id