Programming Scala: Tackle Multi-Core Complexity on the Java Virtual Machine [1 ed.] 193435631X, 9781934356319

As a few others have pointed out, the title is misleading, there is little in the book on the actual subject of "so

264 85 2MB

English Pages 226 Year 2009

Report DMCA / Copyright

DOWNLOAD PDF FILE

Table of contents :
Contents......Page 7
Why Scala?......Page 11
What's Scala?......Page 14
Functional Programming......Page 19
What's in This Book?......Page 22
Acknowledgments......Page 24
Downloading Scala......Page 26
Installing Scala......Page 27
Take Scala for a Ride......Page 28
Scala on the Command Line......Page 30
Running Scala Code as a Script......Page 31
Compiling Scala......Page 32
Scala as Concise Java......Page 34
Scala Classes for Java Primitives......Page 37
Tuples and Multiple Assignments......Page 38
Strings and Multiline Raw Strings......Page 40
Sensible Defaults......Page 41
Operator Overloading......Page 43
Scala Surprises for the Java Eyes......Page 45
Creating Classes......Page 53
Defining Fields, Methods, and Constructors......Page 54
Extending a Class......Page 57
Singleton Object......Page 58
Stand-Alone and Companion Objects......Page 60
static in Scala......Page 61
Sensible Typing......Page 63
Collections and Type Inference......Page 64
The Any Type......Page 66
More About Nothing......Page 67
Option Type......Page 68
Method Return Type Inference......Page 69
Passing Variable Arguments (Varargs)......Page 70
Variance of Parameterized Type......Page 71
Moving from Normal to Higher-Order Functions......Page 75
Function Values......Page 76
Function Values with Multiple Parameters......Page 78
Currying......Page 80
Reusing Function Values......Page 81
Positional Notation for Parameters......Page 83
Execute Around Method Pattern......Page 84
Partially Applied Functions......Page 87
Closures......Page 88
Traits......Page 91
Selective Mixins......Page 94
Decorating with Traits......Page 95
Method Late Binding in Traits......Page 97
Implicit Type Conversions......Page 99
Common Scala Collections......Page 103
Using a Set......Page 104
Using a Map......Page 106
Using a List......Page 108
The for Expression......Page 113
Matching Literals and Constants......Page 116
Matching a Wildcard......Page 117
Matching Tuples and Lists......Page 118
Matching with Types and Guards......Page 119
Pattern Variables and Constants in case Expressions......Page 120
Matching Using case Classes......Page 121
Matching Using Extractors......Page 124
Regular Expressions......Page 128
Regular Expressions as Extractors......Page 129
Promote Immutability......Page 131
Concurrency Using Actor......Page 133
Message Passing......Page 137
The Actor Class......Page 139
The actor Method......Page 141
receive and receiveWithin Methods......Page 144
react and reactWithin Methods......Page 146
loop and loopWhile......Page 151
Controlling Thread of Execution......Page 153
Choosing Among the Receive Methods......Page 154
Using Scala Classes in Scala......Page 156
Using Java Classes in Scala......Page 159
Using Scala Classes in Java......Page 161
Extending Classes......Page 165
Using JUnit......Page 167
Start with a Canary Test......Page 169
Using Runner......Page 170
Asserts......Page 172
Exception Tests......Page 174
Sharing Code Between Tests......Page 176
Functional Style with FunSuite......Page 178
Running ScalaTests Using JUnit......Page 179
Exception Handling......Page 183
Mind the Catch Order......Page 186
Getting Users' Input......Page 187
Reading and Writing Files......Page 188
XML as a First-Class Citizen......Page 190
Reading and Writing XML......Page 193
Getting Stock Prices from the Web......Page 196
Making the Net Asset Application Concurrent......Page 199
Putting a GUI on the Net Asset Application......Page 201
Web Resources......Page 211
Bibliography......Page 213
A......Page 215
C......Page 216
F......Page 217
M......Page 218
O......Page 219
S......Page 220
U......Page 221
Y......Page 222

Programming Scala: Tackle Multi-Core Complexity on the Java Virtual Machine [1 ed.]
 193435631X, 9781934356319

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
File loading please wait...
Recommend Papers