292
■INDEX
changed method, 147
characters, escaping, 80–81
chat server, with dynamic message handling,
150–152
class declarations, 22–23
class hierarchies
with invariant type parameters, 209
traits and, 184–190
class hierarchy, 27, 133–134
classes
adding methods to existing, 175–180
anonymous inner, 47
case, 36–39, 120–122, 126–127
collections, 49, 51–53, 66–71
composing, 278–279
contravariant, 211–213
covariant, 210–211
inner, 26, 47
invariant, 208–210
Java, 45–46
Ruby, 45–46
Scala, 22–23, 26–27, 45–46
See also specific classes
cnt variable, 140
code, Java vs. Scala, 56–61. See also Java code;
Scala code
code blocks, 31, 48
collection manipulation methods, 71
collections classes, 49, 51–53
lazy, 52
List, 53–66
Map, 67–71
mutable vs. immutable, 53
Option, 72–74
Tuples, 66–67
columns
concrete, 198–199
table mapping, 197
column types, 197–198
ColumnTypes, 198
combinators, 235–237
Comet support, 288–289
CometActors, 289
command line, Scala at, 11–13
comments, 45
CommitXAction message, 160
companion objects, 178
compatibility
of Scala, 283–284
with JVM, 285
compiler, 35
compiling, Scala programs, 13–14
composed functions, 105–107
composition
of classes, 278–279
of functions, 278–279
concurrency, 87–91, 137–138
cons cells, 53, 123, 129
containers
functions in, 103–104
contravariant parameter types, 211–213
control structures
building, 109–112
for running queries, 201
covariance, 207–208
covariant parameter types, 210–211
covariants, 128
■D
data hiding, 131–136
data structures, immutable, 49–51
data types, testing, 119–120
def keyword, 16–17, 28
dependency-management systems, 266–269
dependent types, 221
domain-specific languages (DSLs), 171, 273
doSet method, 90
duck typing, 110, 138
Dwemthy’s stairs (example), 214–231
■E
ECMAScript, 242
elem method, 235
else expression, 79
Emir, Burak, 5
equals method, 37
Erlang, 138, 140
events, binding functions to, 103–104
Excel, 56
exceptions, 43, 68–69
exceptions function, 130
expressions, 105–106
evaluating, 106–108
nesting, 41–42
■F
Federal Institute of Technology, Swiss (EPFL), 5
FieldProduct class, 200, 203
FieldType class, 198
filter method, 55, 56, 71
find method, 199–201
flatMap method, 18–19, 64–65, 69–70, 275
foldLeft method, 19, 63, 66, 71, 240
for comprehensions, 41–43, 65, 76, 83, 253, 258
fromList method, 259
fsc compiler, 13–14
FT parameter, 199–200
functional languages, 97
functional programming (FP), 131–136
FunctionN trait, 213
FunctionNN trait, 97
functions, 34–35, 47
array of, 103
binding to events, 103–104
19897IDX.fm Page 292 Monday, April 27, 2009 3:41 PM