Programming in Scala, Fourth Edition
豆瓣
A comprehensive step-by-step guide
Martin Odersky / Lex Spoon …
简介
This book is the authoritative tutorial on the Scala programming language, co-written by the language's designer, Martin Odersky. This fourth edition brings the entire book up to date, adding new material to cover changes in Scala 2.13, in particular the overhaul of Scala collections. This edition covers these changes in detail, including:
The new collections type hierarchy
New concrete collection types
New methods added to collections
The new ways to define your own collection types
The new, simplified views
contents
What Readers are Saying ii
Contents xiii
List of Figures xxiii
List of Tables xxv
List of Listings xxvii
Foreword xxxv
Acknowledgments xxxvii
Introduction xli
1. A Scalable Language 3
2. First Steps in Scala 23
3. Next Steps in Scala 37
4. Classes and Objects 59
5. Basic Types and Operations 73
6. Functional Objects 97
7. Built-in Control Structures 117
8. Functions and Closures 143
9. Control Abstraction 167
10. Composition and Inheritance 183
11. Scala's Hierarchy 211
12. Traits 223
13. Packages and Imports 243
14. Assertions and Tests 261
15. Case Classes and Pattern Matching 273
16. Working with Lists 307
17. Working with Other Collections 341
18. Mutable Objects 363
19. Type Parameterization 387
20. Abstract Members 413
21. Implicit Conversions and Parameters 445
22. Implementing Lists 471
23. For Expressions Revisited 485
24. Collections in Depth 501
25. The Architecture of Scala Collections 569
26. Extractors 603
27. Annotations 619
28. Working with XML 627
29. Modular Programming Using Objects 641
30. Object Equality 657
31. Combining Scala and Java 681
32. Futures and Concurrency 697
33. Combinator Parsing 719
34. GUI Programming 749
35. The SCells Spreadsheet 761
A. Scala Scripts on Unix and Windows 787
Glossary 789
Bibliography 805
About the Authors 809
Index 811