Foreword
Preface
1. Zero to Sixty: Introducing Scala
Why Scala?
The Seductions of Scala
What About Java 8?
Installing Scala
Using SBT
Running the Scala Command-Line Tools
Running the Scala REPL in IDEs
A Taste of Scala
A Taste of Concurrency
Recap and What''s Next
2. Type Less, Do More
Semicolons
Variable Declarations
Ranges
Partial Functions
Method Declarations
Method Default and Named Arguments
Methods with Multiple Argument Lists
A Taste of Futures
Nesting Method Definitions and Recursion
Inferring Type Information
Reserved Words
Literal Values
Integer Literals
Floating-Point Literals
Boolean Literals
Character Literals
String Literals
Symbol Literals
Function Literals
Tuple Literals
Option, Some, and None: Avoiding nulls
Sealed Class Hierarchies
Organizing Code in Files and Namespaces
Importing Types and Their Members
Imports Are Relative
Package Objects
Abstract Types Versus Parameterized Types
Recap and What''s Next
3. Rounding 0ut the Basics
Operator Overloading?
Syntactic Sugar
Methods with Empty Argument Lists
Precedence Rules
Domain-Specific Languages
Scala if Statements
Scala for Comprehensions
for Loops
Generator Expressions
Guards: Filtering Values
Yielding
Expanded Scope and Value Definitions
Other Looping Constructs
Scala while Loops
Scala do-while Loops
Conditional Operators
Using try, catch, and finally Clauses
Call by Name, Call by Value
lazy val
Enumerations
Interpolated Strings
Traits: Interfaces and "Mixins" in Scala
Recap and What''s Next
4. Pattern Matching
5. Implicits
6. Functional Programming in Scala
7. for Comprehensions in Depth
8. Object-Oriented Programming in Scala
9. Traits
10. The Scala Object System, Part Ⅰ
11. The Scala Object System, Part Ⅱ.
12. The Scala Collections Library
13. Visibility Rules
14. Scala''s Type System, Part Ⅰ
15. Scala''s Type System, Part Ⅱ
16. Advanced Functional Programming
17. Tools for Concurrency
18. Scala for Big Data
19. Dynamic Invocation in Scala.
20. Domain-Specific Languages in Scala
21. Scala Tools and Libraries.
22. Java Interoperability.
23. Application Design
24. Metaprogramming: Macros and Reflection.
A. References
Index