|
Scala is an object-oriented programming language for the Java Virtual Machine. In addition to being object-oriented, Scala is also a functional language, and combines the best approaches to OO and functional programming. In Italian, Scala means a stairway, or steps—indeed, Scala lets you step up to a programming environment that incorporates some of the best recent thinking in programming language design while also letting you use all your existing Java code. Artima is very pleased to publish the first book on Scala, written by the designer of the language, Martin Odersky. Co-authored by Lex Spoon and Bill Venners, this book takes a step-by-step tutorial approach to teaching you Scala. Starting with the fundamental elements of the language, Programming in Scala introduces functional programming from the practitioner's perspective, and describes advanced language features that can make you a better, more productive developer. |
Contents ix
List of Figures xix
List of Tables xxi
List of Listings xxii
Foreword xxix
Acknowledgments xxxi
Introduction xxxiii
1. A Scalable Language 3 (download free sample chapter PDF)
2. First Steps in Scala 23 (download free sample chapter PDF)
3. Next Steps in Scala 37
4. Classes and Objects 59
5. Basic Types and Operations 73
6. Functional Objects 95
7. Built-in Control Structures 115
8. Functions and Closures 139
9. Control Abstraction 161
10. Composition and Inheritance 177
11. Scala's Hierarchy 205
12. Traits 213
13. Packages and Imports 233
14. Assertions and Unit Testing 249
15. Case Classes and Pattern Matching 263
16. Working with Lists 297
17. Collections 329
18. Stateful Objects 357
19. Type Parameterization 381
20. Abstract Members 407 (download free sample chapter PDF)
21. Implicit Conversions and Parameters 437
22. Implementing Lists 459
23. For Expressions Revisited 473
24. Extractors 489
25. Annotations 505
26. Working with XML 513
27. Modular Programming Using Objects 527
28. Object Equality 543
29. Combining Scala and Java 569
30. Actors and Concurrency 583
31. Combinator Parsing 619
32. GUI Programming 649
33. The SCells Spreadsheet 661
A. Scala scripts on Unix and Windows 687
Glossary 689
Bibliography 705
About the Authors 709
Index 711
|
Martin Odersky is the creator of the Scala language. As a professor at EPFL in Lausanne, Switzerland he is working on programming languages, more specifically languages for object-oriented and functional programming. His research thesis is that the two paradigms are two sides of the same coin, to be identified as much as possible. To prove this, he has experimented with a number of language designs, from Pizza to GJ to Functional Nets. He has also influenced the development of Java as a co-designer of Java generics and as the original author of the current javac reference compiler. Since 2001 he has concentrated on designing, implementing, and refining the Scala programming language. Lex Spoon worked on Scala for two years as a post-doc at EPFL. He has a Ph.D. in computer science from Georgia Tech. His research is on programming environments and on better support for distributed development. In addition to Scala, he has worked on a wide variety of languages, including the dynamic language Smalltalk and the scientific language X10. He and his wife live in Atlanta with two cats and a turtle. Bill Venners is president of Artima, Inc., which publishes the Artima Developer website at www.artima.com. He is author of the book, Inside the Java Virtual Machine, a programmer-oriented survey of the Java platform's archi- tecture and internals. His popular columns in JavaWorld magazine covered Java internals, object-oriented design, and Jini. Bill has been active in the Jini Community since its inception. He led the Jini Community's ServiceUI project, whose ServiceUI API became the de facto standard way to associate user interfaces to Jini services. Bill Venners is also the designer of ScalaTest, an open source testing tool for Scala and Java developers. |
Copyright © 2008 Artima, Inc. All rights reserved.