新書推薦:

《
从一道高三数学模拟测试题的背景谈起:兼谈等周问题与等周不等式
》
售價:HK$
74.8

《
《仪礼》版本研究:全三册
》
售價:HK$
383.9

《
水浒传绘本 全8册 水浒桥梁书 同步原著改编去暴力 萌趣卡通国风画卷 文史科普趣味拓展
》
售價:HK$
228.8

《
中国清代戏曲史上、下卷(套装2册)
》
售價:HK$
437.8

《
私域裂变运营实战手册
》
售價:HK$
54.8

《
超越高定
》
售價:HK$
657.8

《
耶鲁大学公开课 心理学导论
》
售價:HK$
72.6

《
三江源·可可西里野生动物图鉴(兽类卷)
》
售價:HK$
140.8
|
| 編輯推薦: |
|
作者斯沃茨在《学习Scala影印版英文版》中论证了为什么ScaIa凭借其简洁而具有表达性的语法使其成为想提高水平的Ruby和Python开发者的理想语言,同时Scala的类型安全性和性能保证了它对于任何应用而言都足够稳定和快速。
|
| 內容簡介: |
|
为什么需要学习Scala?你不需要像数据科学家或者分布式计算专家一样理解这个面向对象的函数式编程语言。《学习Scala(影印版)(英文版)》提供了对Scala全面而易读的介绍,包括语法图、示例和练习。在深入了解高阶函数和不可变数据结构前,你将首先接触Scala的核心类型与语法。
|
| 關於作者: |
作者:(美国)斯沃茨(JasonSwartz)
斯沃茨(JasonSwartz),是一位软件开发者,酷爱直观的用户界面、具有表达性的编程语言和简明的用户文档。他曾组织了在sanFrancisco举行的scala社区会议并为Netflix的顾客设备项目开发应用。
|
| 目錄:
|
Preface.
Part Ⅰ.Core Scala
1.Getting Started with the Scalable Language
Installing Scala
Using the Scala REPL
Summary
Exercises
2.Working with Data: Literals, Values, Variables, and Types
Values
Variables
Naming
Types
Numeric Data Types
Strings
An Overview of Scala Types
Tuples
Summary
Exercises
3.Expressions and Conditionals
Expressions
Defining Values and Variables with Expressions
Expression Blocks
Statements
If..Else Expression Blocks
If Expressions
If—Else Expressions
Match Expressions
Matching with Wildcard Patterns
Matching with Pattern Guards
Matching Types with Pattern Variables
Loops
Iterator Guards
Nested Iterators
Value Binding
While and Do/While Loops
Summary
Exercises
4.Functions
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
5.First—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
6.Common Collections
Lists, Sets, and Maps
What''s in a List?
The Cons Operator
List Arithmetic
Mapping Lists
Reducing Lists
Converting Collections
Java and Scala Collection Compatibility
Pattern Matching with Collections
Summary
Exercises
7.M0te Collections
Mutable Collections
Creating New Mutable Collections
Creating Mutable Collections from Immutable Ones
Using Collection Builders
Arrays
Seq and Sequences
Streams
Monadic Collections
Option Collections
Try Collections
Future Collections
Summary
Exercises
Part Ⅱ.Object—Oriented Scala
8.Classes
Defining Classes
More Class Types
Abstract Classes
Anonymous Classes
More Field and Method Types
Overloaded Methods
Apply Methods
Lazy Values
Packaging
Accessing Packaged Classes
Packaging Syntax
Privacy Controls
Privacy Access Modifiers
Final and Sealed Classes
Summary
Exercises
9.Objects, Case Classes, and Traits
Objects
Apply Methods and Companion Objects
Command—Line Applications with Objects
Case Classes
Traits
Self Types
Instantiation with Traits
Importing Instance Members
Summary
Break——Configuring Your First Scala Project
Exercises
10.Advancefl Typing
Tuple and Function Value Classes
Implicit Parameters
Implicit Classes
Types
Type Aliases
Abstract Types
Bounded Types
Type Variance
Package Objects
Summary
Questions
A.Reserved Words
Index
|
| 內容試閱:
|
An alternate but now unofflcially deprecated syntax you will see for procedures is to define them without the Unit return type and without an equals sign before the procedure body.With this syntax the example log () method would be written like this:
scaladef log(d: Double) {println(f"Got value $dth.2f")}
log: (d: Double)Unit
As just noted, this syntax is unofficially deprecated by the maintainers of the Scala language.The problem with this syntax is that too many developers accidentally wrote procedures with return values, expecting the return value to be actually returned to the caller.With this procedure syntax, any return value (or Fmal expression) will be discarded.To address this problem, it is recommended that developers stick to regular function defmitions with an equals sign to reduce the possibility that valid return values will be ignored.
Functions with Empty Parentheses
An alternate way to defme and invoke an input—less function (one which has no input parameters) is with empty parentheses.You might fmd this style preferable because it clearly distinguishes the function from a value.
|
|