297
■INDEX
throwing exceptions, 43
time attribute, 78
TIMEOUT message, 159–160
toInt method, 16–18
toList method, 56
toString method, 36–37
traits, 18, 23–24, 47, 181–190
class hierarchies and, 184–190
composing, into Actors, 164–169
creating, 181–183
defining generic, 197
sealed, 202–203
using, 183–184
transactional Actors, 155–164
transactions
ACID, 153
implementing using Actors, 153–164
performing, 155–161
transform method, 85
try/catch/finally construct, 43–44
try/finally construct, 110, 112
Tuples, 66–67, 198–199, 203
Twisted event library, 287
Twitter JSON parsing, 252–261
TwitterStatus instances, 259
TwitterUser class, 259
type inferencer, 206
type parameters, 197–202
contravariant, 211–213
covariant, 210–211
functions and, 99–100
invariant, 208–210
variance and, 208
types, 190–207
column, 197–198
defining, 221
dependent, 221
implicit conversions, 173–175
structural, 182
type-safe map utility, 253–255
type-safe queries, 191, 201–202
type safety, 230, 206–207
type variance. See variance
■U
Unit class, 27, 79
unityped languages, 138
Update message, 154–155
update method, 35–36
URLs, expressing as List, 130
using control structure, 109–112
■V
val keyword, 19, 30, 101
vals, 275–276
var keyword, 19, 30, 101
variable declarations, 30–31
variables
assign-many, 19
assign-once, 19
call-by-name, 107–109
functions bound to, in scope, 100–102
variable types, 30
variance, 207–213
contravariant parameter types, 211–213
covariant parameter types, 210–211
invarient parameter types, 208–210
rules of, 213
vars, 275
Venners, Bill, 265
visitor pattern, 133–134
■W
Wadler, Philip, 5
Webb, Jamie, 9
while statements, 40–41
_wildcard pattern, 119
Windows, installing Scala on, 6–7
■X
XAction message, 159
XML
constants, 20
escaped characters, 80–81
literals, 75, 78
parsing, 81–84
in Scala code, 75–81
testing, 264
transformations, 84–86
19897IDX.fm Page 297 Monday, April 27, 2009 3:41 PM