Scala By Example (Scala qua ví dụ) - Martin Odersky
正在生成预览...
Giáo trình giới thiệu ngôn ngữ lập trình Scala qua các ví dụ, bao gồm các khái niệm cơ bản và nâng cao như hàm, lớp, danh sách, kiểu generic, xử lý đồng thời.
描述
Scala By Example DRAFT May 24, 2011 Martin Odersky P ROGRAMMING M ETHODS L ABORATORY EPFL S WITZERLAND Contents 1 Introduction 1 2 A First Example 3 3 Programming with Actors and Messages 7 4 Expressions and Simple Functions 11 4.1 Expressions And Simple Functions . . . . . . . . . . . . . . . . . . . . . . 11 4.2 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.3 Conditional Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.4 Example: Square Roots by Newton’s Method . . . . . . . . . . . . . . . . 15 4.5 Nested Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4.6 Tail Recursion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 5 First-Class Functions 21 5.1 Anonymous Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 5.2 Currying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 5.3 Example: Finding Fixed Points of Functions . . . . . . . . . . . . . . . . 25 5.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 5.5 Language Elements Seen So Far . . . . . . . . . . . . . . . . . . . . . . . 28 6 Classes and Objects 31 7 Case Classes and Pattern Matching 43 7.1 Case Classes and Case Objects . . . . . . . . . . . . . . . . . . . . . . . . 46 7.2 Pattern Matching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 8 Generic Types and Methods 51 8.1 Type Parameter Bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 8.2 Variance Annotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 iv CONTENTS 8.3 Lower Bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 8.4 Least Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 8.5 Tuples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 8.6 Functions . . . . . . . . . . . . . . . . . .
AI 摘要
- 文档名称
- Scala By Example (Scala qua ví dụ) - Martin Odersky
- 作者(文档中)
- Martin Odersky
- 内容
- Tài liệu 'Scala By Example' là một bản nháp giới thiệu ngôn ngữ lập trình Scala thông qua các ví dụ thực tế. Nó bao gồm các chủ đề từ cơ bản như biểu thức và hàm đến các khái niệm nâng cao như Actors, kiểu dữ liệu chung và tính đồng thời.
- 目录
- 4.1 Expressions And Simple Functions
- 4.2 Parameters
- 4.3 Conditional Expressions
- 4.4 Example: Square Roots by Newton’s Method
- 4.5 Nested Functions
- 4.6 Tail Recursion
- 5.1 Anonymous Functions
- 5.2 Currying
- 5.3 Example: Finding Fixed Points of Functions
- 5.4 Summary
- 5.5 Language Elements Seen So Far
- 7.1 Case Classes and Case Objects
- 7.2 Pattern Matching
- 8.1 Type Parameter Bounds
- 8.2 Variance Annotations
- 8.3 Lower Bounds
- 8.4 Least Types
- 8.5 Tuples
- 8.6 Functions
- 9.1 Using Lists
- 9.2 Definition of class List I: First Order Methods
- 9.3 Example: Merge sort
- 9.4 Definition of class List II: Higher-Order Methods
- 9.5 Summary
- 10.1 The N-Queens Problem
- 10.2 Querying with For-Comprehensions
- 10.3 Translation of For-Comprehensions
- 10.4 For-Loops
- 10.5 Generalizing For
- 11.1 Stateful Objects
- 11.2 Imperative Control Structures
- 11.3 Extended Example: Discrete Event Simulation
- 11.4 Summary
- 13.1 Iterator Methods
- 13.2 Constructing Iterators
- 13.3 Using Iterators
- 17.1 Signals and Monitors
- 17.2 SyncVars
- 17.3 Futures
- 17.4 Parallel Computations
- 17.5 Semaphores
- 17.6 Readers/Writers
- 17.7 Asynchronous Channels
- 17.8 Synchronous Channels
- 17.9 Workers
- 17.10Mailboxes
- 17.11Actors
- Chapter
- 页数
- 145 页
- 上传者
- lienhejb
常见问题
此文档免费吗?
是的。“Scala By Example (Scala qua ví dụ) - Martin Odersky”是免费的 — 只需登录并点击“下载”即可获取原始文件。
这份文档有多少页?
该文档共有 145 页。您可以在下载前进行在线预览。
我可以在下载前预览吗?
是的。您可以通过在线阅读器直接在本页面预览此文档,然后再决定是否下载。
Scala By Example (Scala qua ví dụ) - Martin Odersky
正在生成预览...
Scala By Example DRAFT May 24, 2011 Martin Odersky P ROGRAMMING M ETHODS L ABORATORY EPFL S WITZERLAND Contents 1 Introduction 1 2 A First Example 3 3 Programming with Actors and Messages 7 4 Expressions and Simple Functions 11 4.1 Expressions And Simple Functions . . . . . . . . . . . . . . . . . . . . . . 11 4.2 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.3 Conditional Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.4 Example: Square Roots by Newton’s Method . . . . . . . . . . . . . . . . 15 4.5 Nested Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4.6 Tail Recursion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 5 First-Class Functions 21 5.1 Anonymous Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 5.2 Currying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 5.3 Example: Finding Fixed Points of Functions . . . . . . . . . . . . . . . . 25 5.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 5.5 Language Elements Seen So Far . . . . . . . . . . . . . . . . . . . . . . . 28 6 Classes and Objects 31 7 Case Classes and Pattern Matching 43 7.1 Case Classes and Case Objects . . . . . . . . . . . . . . . . . . . . . . . . 46 7.2 Pattern Matching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 8 Generic Types and Methods 51 8.1 Type Parameter Bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 8.2 Variance Annotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 iv CONTENTS 8.3 Lower Bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 8.4 Least Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 8.5 Tuples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 8.6 Functions . . . . . . . . . . . . . . . . . .
阅读全文
- 文档名称
- Scala By Example (Scala qua ví dụ) - Martin Odersky
- 作者(文档中)
- Martin Odersky
- 内容
- Tài liệu 'Scala By Example' là một bản nháp giới thiệu ngôn ngữ lập trình Scala thông qua các ví dụ thực tế. Nó bao gồm các chủ đề từ cơ bản như biểu thức và hàm đến các khái niệm nâng cao như Actors, kiểu dữ liệu chung và tính đồng thời.
- 目录
- 4.1 Expressions And Simple Functions
- 4.2 Parameters
- 4.3 Conditional Expressions
- 4.4 Example: Square Roots by Newton’s Method
- 4.5 Nested Functions
- 4.6 Tail Recursion
- 5.1 Anonymous Functions
- 5.2 Currying
- 5.3 Example: Finding Fixed Points of Functions
- 5.4 Summary
- 5.5 Language Elements Seen So Far
- 7.1 Case Classes and Case Objects
- 7.2 Pattern Matching
- 8.1 Type Parameter Bounds
- 8.2 Variance Annotations
- 8.3 Lower Bounds
- 8.4 Least Types
- 8.5 Tuples
- 8.6 Functions
- 9.1 Using Lists
- 9.2 Definition of class List I: First Order Methods
- 9.3 Example: Merge sort
- 9.4 Definition of class List II: Higher-Order Methods
- 9.5 Summary
- 10.1 The N-Queens Problem
- 10.2 Querying with For-Comprehensions
- 10.3 Translation of For-Comprehensions
- 10.4 For-Loops
- 10.5 Generalizing For
- 11.1 Stateful Objects
- 11.2 Imperative Control Structures
- 11.3 Extended Example: Discrete Event Simulation
- 11.4 Summary
- 13.1 Iterator Methods
- 13.2 Constructing Iterators
- 13.3 Using Iterators
- 17.1 Signals and Monitors
- 17.2 SyncVars
- 17.3 Futures
- 17.4 Parallel Computations
- 17.5 Semaphores
- 17.6 Readers/Writers
- 17.7 Asynchronous Channels
- 17.8 Synchronous Channels
- 17.9 Workers
- 17.10Mailboxes
- 17.11Actors
- Chapter
- 页数
- 145 页
- 上传者
- lienhejb
评论 (0)
暂无评论。快来抢沙发吧!
Ngân hàng đề thi môn: Hệ thống thông tin quản lý
Đề thi môn Cơ sở dữ liệu (kèm Đáp án) - Đại học Sư phạm kỹ thuật
Đề thi và đáp án môn Hệ thống thông tin kế toán
Đề thi và đáp án môn Cấu trúc dữ liệu giải thuật
Đáp án đề thi môn Mạng máy tính - ĐH Công nghệ thông tin (CNTT)
K5 Bộ đề luyện thi Trạng Nguyên Tiếng Việt (NXB DHQG)
K2 Bộ đề luyện thi Trạng Nguyên Tiếng Việt (NXB DHQG)
K3 Bộ đề luyện thi Trạng Nguyên Tiếng Việt (NXB DHQG)
K4 Bộ đề luyện thi Trạng Nguyên Tiếng Việt (NXB DHQG)
K1 Bộ đề luyện thi Trạng Nguyên Tiếng Việt (NXB DHQG)
评论 (0)
暂无评论。快来抢沙发吧!