Learning Scala
O'Reilly Media (Verlag)
978-1-4493-6793-0 (ISBN)
Why learn Scala? You don’t need to be a data scientist or distributed computing expert to appreciate this object-oriented functional programming language. This practical book provides a comprehensive yet approachable introduction to the language, complete with syntax diagrams, examples, and exercises. You’ll start with Scala's core types and syntax before diving into higher-order functions and immutable data structures.
Author Jason Swartz demonstrates why Scala’s concise and expressive syntax make it an ideal language for Ruby or Python developers who want to improve their craft, while its type safety and performance ensures that it’s stable and fast enough for any application.
- Learn about the core data types, literals, values, and variables
- Discover how to think and write in expressions, the foundation for Scala's syntax
- Write higher-order functions that accept or return other functions
- Become familiar with immutable data structures and easily transform them with type-safe and declarative operations
- Create custom infix operators to simplify existing operations or even to start your own domain-specific language
- Build classes that compose one or more traits for full reusability, or create new functionality by mixing them in at instantiation
Jason Schwartz is a Software Engineer in the San Francisco Bay Area, developing Scala applications at Loyal3 and Netflix. Before making the switch to functional programming he managed the developer docs and support team at eBay, wrote advertising and merchandising platforms in Java and built tools and UI prototypes at Apple.
Core Scala
Chapter 1Getting Started with the Scalable Language
Installing Scala
Using the Scala REPL
Summary
Exercises
Chapter 2Working with Data: Literals, Values, Variables, and Types
Values
Variables
Naming
Types
Summary
Exercises
Chapter 3Expressions and Conditionals
Expressions
If..Else Expression Blocks
Match Expressions
Loops
Summary
Exercises
Chapter 4Functions
Procedures
Functions with Empty Parentheses
Function Invocation with Expression Blocks
Recursive Functions
Nested Functions
Calling Functions with Named Parameters
Parameters with Default Values
Vararg Parameters
Parameter Groups
Type Parameters
Methods and Operators
Writing Readable Functions
Summary
Exercises
Chapter 5First-Class Functions
Function Types and Values
Higher-Order Functions
Function Literals
Placeholder Syntax
Partially Applied Functions and Currying
By-Name Parameters
Partial Functions
Invoking Higher-Order Functions with Function Literal Blocks
Summary
Exercises
Chapter 6Common Collections
Lists, Sets, and Maps
What’s in a List?
List Arithmetic
Mapping Lists
Reducing Lists
Converting Collections
Pattern Matching with Collections
Summary
Exercises
Chapter 7More Collections
Mutable Collections
Arrays
Seq and Sequences
Streams
Monadic Collections
Summary
Exercises
Object-Oriented Scala
Chapter 8Classes
Defining Classes
More Class Types
More Field and Method Types
Packaging
Privacy Controls
Privacy Access Modifiers
Final and Sealed Classes
Summary
Exercises
Chapter 9Objects, Case Classes, and Traits
Objects
Case Classes
Traits
Importing Instance Members
Summary
Break—Configuring Your First Scala Project
Exercises
Chapter 10Advanced Typing
Tuple and Function Value Classes
Implicit Parameters
Implicit Classes
Types
Summary
Questions
Appendix Reserved Words
Erscheint lt. Verlag | 27.1.2015 |
---|---|
Zusatzinfo | black & white illustrations |
Verlagsort | Sebastopol |
Sprache | englisch |
Maße | 178 x 233 mm |
Gewicht | 408 g |
Einbandart | Paperback |
Themenwelt | Informatik ► Software Entwicklung ► Objektorientierung |
Schlagworte | Scala (Programmiersprache); Handbuch/Lehrbuch |
ISBN-10 | 1-4493-6793-3 / 1449367933 |
ISBN-13 | 978-1-4493-6793-0 / 9781449367930 |
Zustand | Neuware |
Haben Sie eine Frage zum Produkt? |
aus dem Bereich