Programming Scala (1ST)

  • ポイントキャンペーン

Programming Scala (1ST)

  • ただいまウェブストアではご注文を受け付けておりません。 ⇒古書を探す
  • 製本 Paperback:紙装版/ペーパーバック版/ページ数 422 p.
  • 言語 ENG
  • 商品コード 9780596155957
  • DDC分類 005.133

Table of Contents

Foreword                                           xv
Preface xvii
Zero to Sixty: Introducing Scala 1 (22)
Why Scala? 1 (7)
If You Are a Java Programmer... 1 (1)
If You Are a Ruby, Python, etc. 2 (2)
Programmer...
Introducing Scala 4 (3)
The Seductions of Scala 7 (1)
Installing Scala 8 (2)
For More Information 10 (1)
A Taste of Scala 10 (6)
A Taste of Concurrency 16 (5)
Recap and What's Next 21 (2)
Type Less, Do More 23 (30)
In This Chapter 23 (1)
Semicolons 23 (1)
Variable Declarations 24 (1)
Method Declarations 25 (4)
Method Default and Named Arguments 26 (2)
(Scala Version 2.8)
Nesting Method Definitions 28 (1)
Inferring Type Information 29 (7)
Literals 36 (4)
Integer Literals 36 (1)
Floating-Point Literals 37 (1)
Boolean Literals 38 (1)
Character Literals 38 (1)
String Literals 39 (1)
Symbol Literals 39 (1)
Tuples 40 (1)
Option, Some, and None: Avoiding nulls 41 (3)
Organizing Code in Files and Namespaces 44 (1)
Importing Types and Their Members 45 (2)
Imports are Relative 46 (1)
Abstract Types And Parameterized Types 47 (2)
Reserved Words 49 (3)
Recap and What's Next 52 (1)
Rounding Out the Essentials 53 (22)
Operator? Operator? 53 (2)
Syntactic Sugar 54 (1)
Methods Without Parentheses and Dots 55 (2)
Precedence Rules 56 (1)
Domain-Specific Languages 57 (1)
Scala if Statements 58 (1)
Scala for Comprehensions 59 (2)
A Dog-Simple Example 59 (1)
Filtering 60 (1)
Yielding 60 (1)
Expanded Scope 61 (1)
Other Looping Constructs 61 (2)
Scala while Loops 61 (1)
Scala do-while Loops 62 (1)
Generator Expressions 62 (1)
Conditional Operators 63 (1)
Pattern Matching 63 (9)
A Simple Match 64 (1)
Variables in Matches 64 (1)
Matching on Type 65 (1)
Matching on Sequences 65 (1)
Matching on Tuples (and Guards) 66 (1)
Matching on Case Classes 67 (1)
Matching on Regular Expressions 68 (1)
Binding Nested Variables in Case Clauses 69 (1)
Using try, catch, and finally Clauses 70 (1)
Concluding Remarks on Pattern Matching 71 (1)
Enumerations 72 (2)
Recap and What's Next 74 (1)
Traits 75 (14)
Introducing Traits 75 (7)
Traits As Mixins 76 (6)
Stackable Traits 82 (4)
Constructing Traits 86 (2)
Class or Trait? 87 (1)
Recap and What's Next 88 (1)
Basic Object-Oriented Programming in Scala 89 (22)
Class and Object Basics 89 (2)
Parent Classes 91 (1)
Constructors in Scala 91 (4)
Calling Parent Class Constructors 94 (1)
Nested Classes 95 (1)
Visibility Rules 96 (14)
Public Visibility 98 (1)
Protected Visibility 99 (1)
Private Visibility 100 (2)
Scoped Private and Protected Visibility 102 (8)
Final Thoughts on Visibility 110 (1)
Recap and What's Next 110 (1)
Advanced Object-Oriented Programming In 111 (34)
Scala
Overriding Members of Classes and Traits 111 (15)
Attempting to Override final 112 (1)
Declarations
Overriding Abstract and Concrete Methods 112 (2)
Overriding Abstract and Concrete Fields 114 (1)
Overriding Abstract and Concrete Fields 114 (5)
in Traits
Overriding Abstract and Concrete Fields 119 (1)
in Classes
Overriding Abstract Types 120 (3)
When Accessor Methods and Fields Are 123 (3)
Indistinguishable: The Uniform Access
Principle
Companion Objects 126 (10)
Apply 127 (2)
Unapply 129 (3)
Apply and UnapplySeq for Collections 132 (1)
Companion Objects and Java Static 133 (3)
Methods
Case Classes 136 (6)
Syntactic Sugar for Binary Operations 139 (1)
The copy Method in Scala Version 2.8 140 (1)
Case Class Inheritance 140 (2)
Equality of Objects 142 (2)
The equals Method 143 (1)
The == and != Methods 143 (1)
The ne and eq Methods 143 (1)
Array Equality and the sameElements 143 (1)
Method
Recap and What's Next 144 (1)
The Scala Object System 145 (20)
The Predef Object 145 (3)
Classes and Objects: Where Are the 148 (3)
Statics?
Package Objects 150 (1)
Sealed Class Hierarchies 151 (4)
The Scala Type Hierarchy 155 (4)
Linearization of an Object's Hierarchy 159 (5)
Recap and What's Next 164 (1)
Functional Programming in Scala 165 (28)
What Is Functional Programming? 165 (2)
Functions in Mathematics 166 (1)
Variables that Aren't 166 (1)
Functional Programming in Scala 167 (3)
Function Literals and Closures 169 (1)
Purity Inside Versus Outside 169 (1)
Recursion 170 (1)
Tail Calls and Tail-Call Optimization 171 (1)
Trampoline for Tail Calls 172 (1)
Functional Data Structures 172 (2)
Lists in Functional Programming 173 (1)
Maps in Functional Programming 173 (1)
Sets in Functional Programming 174 (1)
Other Data Structures in Functional 174 (1)
Programming
Traversing, Mapping, Filtering, Folding, 174 (8)
and Reducing
Traversal 175 (1)
Mapping 175 (3)
Filtering 178 (1)
Folding and Reducing 179 (2)
Functional Options 181 (1)
Pattern Matching 182 (1)
Partial Functions 183 (1)
Currying 184 (2)
Implicits 186 (2)
Implicit Conversions 186 (2)
Implicit Function Parameters 188 (1)
Final Thoughts on Implicits 189 (1)
Call by Name, Call by Value 189 (1)
Lazy Vals 190 (2)
Recap: Functional Component Abstractions 192 (1)
Robust, Scalable Concurrency with Actors 193 (18)
The Problems of Shared, Synchronized State 193 (1)
Actors 193 (1)
Actors in Abstract 194 (1)
Actors in Scala 194 (9)
Sending Messages to Actors 195 (1)
The Mailbox 196 (1)
Actors in Depth 197 (5)
Effective Actors 202 (1)
Traditional Concurrency in Scala: 203 (7)
Threading and Events
One-Off Threads 203 (1)
Using java.util.concurrent 204 (1)
Events 204 (6)
Recap and What's Next 210 (1)
Herding XML in Scala 211 (6)
Reading XML 211 (3)
Exploring XML 212 (1)
Looping and Matching XML 213 (1)
Writing XML 214 (2)
A Real-World Example 215 (1)
Recap and What's Next 216 (1)
Domain-Specific Languages in Scala 217 (30)
Internal DSLs 218 (12)
A Payroll Internal DSL 222 (1)
Infix Operator Notation 223 (1)
Implicit Conversions and User-Defined 223 (1)
Types
Apply Methods 224 (1)
Payroll Rules DSL Implementation 224 (5)
Internal DSLs: Final Thoughts 229 (1)
External DSLs with Parser Combinators 230 (15)
About Parser Combinators 230 (1)
A Payroll External DSL 230 (3)
A Scala Implementation of the External 233 (6)
DSL Grammar
Generating Paychecks with the External 239 (5)
DSL
Internal Versus External DSLs: Final 244 (1)
Thoughts
Recap and What's Next 245 (2)
The Scala Type System 247 (42)
Reflecting on Types 248 (1)
Understanding Parameterized Types 249 (2)
Manifests 250 (1)
Parameterized Methods 251 (1)
Variance Under Inheritance 251 (8)
Variance of Mutable Types 255 (1)
Variance In Scala Versus Java 256 (3)
Implementation Notes 259 (1)
Type Bounds 259 (8)
Upper Type Bounds 259 (1)
Lower Type Bounds 260 (1)
A Closer Look at Lists 261 (2)
Views and View Bounds 263 (4)
Nothing and Null 267 (1)
Understanding Abstract Types 267 (5)
Parameterized Types Versus Abstract 270 (2)
Types
Path-Dependent Types 272 (3)
C.this 273 (1)
C.super 273 (1)
path.x 274 (1)
Value Types 275 (4)
Type Designators 275 (1)
Tuples 275 (1)
Parameterized Types 275 (1)
Annotated Types 275 (1)
Compound Types 276 (1)
Infix Types 276 (1)
Function Types 277 (2)
Type Projections 279 (1)
Singleton Types 279 (1)
Self-Type Annotations 279 (4)
Structural Types 283 (1)
Existential Types 284 (1)
Infinite Data Structures and Laziness 285 (3)
Recap and What's Next 288 (1)
Application Design 289 (54)
Annotations 289 (11)
Enumerations Versus Pattern Matching 300 (4)
Thoughts On Annotations and Enumerations 304 (2)
Enumerations Versus Case Classes and 304 (2)
Pattern Matching
Using Nulls Versus Options 306 (5)
Options and for Comprehensions 308 (3)
Exceptions and the Alternatives 311 (2)
Scalable Abstractions 313 (8)
Fine-Grained Visibility Rules 314 (2)
Mixin Composition 316 (1)
Self-Type Annotations and Abstract Type 317 (4)
Members
Effective Design of Traits 321 (4)
Design Patterns 325 (15)
The Visitor Pattern: A Better 326 (8)
Alternative
Dependency Injection in Scala: The Cake 334 (6)
Pattern
Better Design with Design By Contract 340 (2)
Recap and What's Next 342 (1)
Scala Tools, Libraries, and IDE Support 343 (44)
Command-Line Tools 343 (10)
Scalac Command-Line Tool 343 (2)
The scala Command-Line Tool 345 (5)
The scalap, javap, and jad Command-Line 350 (2)
Tools
The scaladoc Command-Line Tool 352 (1)
The sbaz Command-Line Tool 352 (1)
The fsc Command-Line Tool 353 (1)
Build Tools 353 (1)
Integration with IDEs 353 (8)
Eclipse 354 (2)
IntelliJ 356 (3)
NetBeans 359 (1)
Text Editors 360 (1)
Test-Driven Development in Scala 361 (6)
Scala Test 361 (2)
Specs 363 (2)
ScalaCheck 365 (2)
Other Notable Scala Libraries and Tools 367 (2)
Lift 367 (1)
Scalaz 368 (1)
Scalax 368 (1)
MetaScala 368 (1)
JavaRebel 368 (1)
Miscellaneous Smaller Libraries 368 (1)
Java Interoperability 369 (8)
Java and Scala Generics 369 (3)
Using Scala Functions in Java 372 (2)
JavaBean Properties 374 (1)
AnyVal Types and Java Primitives 375 (1)
Scala Names in Java Code 375 (2)
Java Library Interoperability 377 (8)
AspectJ 377 (4)
The Spring Framework 381 (3)
Terracotta 384 (1)
Hadoop 384 (1)
Recap and What's Next 385 (2)
Appendix: References 387 (6)
Glossary 393 (14)
Index 407