bitlap / ScalaCookbook

Scala Cookbook 2nd Edition中文翻译初稿
11 stars 2 forks source link

一二级标题 #56

Closed jxnu-liguobin closed 2 years ago

jxnu-liguobin commented 2 years ago

draft 1

~~1. Command-Line Tasks - 命令行任务 1.1 Getting Started with the Scala REPL - 开始使用Scala REPL 1.2 Loading Source Code and JAR Files into the REPL - 将源代码和JAR文件加载进REPL 1.3 Getting Started with the Ammonite REPL - 开始使用Ammonite REPL 1.4 Compiling with scalac and Running with scala - 使用scalac和scala命令 1.5 Disassembling and Decompiling Scala Code - 拆解并反编译Scala代码 1.6 Running JAR Files with Scala and Java - 使用Scala和Java运行JAR文件

  1. Strings - 字符串 2.1 Testing String Equality - 字符串的相等性判断 2.2 Creating Multiline Strings - 使用多行字符串 2.3 Splitting Strings - 字符串的分割 2.4 Substituting Variables into Strings - 字符串的变量替换 2.5 Formatting String Output - 字符串的格式化 2.6 Processing a String One Character at a Time - 每次处理字符串的一个字符 2.7 Finding Patterns in Strings - 在字符串中的查找模式 2.8 Replacing Patterns in Strings - 在字符串中替换模式 2.9 Extracting Parts of a String That Match Patterns - 提取字符串中与模式相匹配的部分 2.10 Accessing a Character in a String - 访问字符串中的字符 2.11 Creating Your Own String Interpolator - 编写自己的字符串插值器 2.12 Creating Random Strings - 生成随机字符串
  2. Numbers and Dates - 数值和日期 3.1 Parsing a Number from a String - 将字符串解析为数值类型 3.2 Converting Between Numeric Types (Casting) - 数值类型间的转换 3.3 Overriding the Default Numeric Type - 覆盖默认的数值类型 3.4 Replacements for ++ and −− - ++和−−的替代方案 3.5 Comparing Floating-Point Numbers - 浮点数的比较 3.6 Handling Large Numbers - 处理大数字 3.7 Generating Random Numbers - 生成随机数 3.8 Formatting Numbers and Currency - 数字和货币的格式化 3.9 Creating New Date and Time Instances - 使用全新的日期和时间 3.10 Calculating the Difference Between Two Dates - 计算两个日期的差值 3.11 Formatting Dates - 日期的格式化 3.12 Parsing Strings into Dates - 将字符串解析为日期类型
  3. Control Structures - 控制结构 4.1 Looping over Data Structures with for - 在数据结构上的for循环 4.2 Using for Loops with Multiple Counters - 使用具有多个计数器的for循环 4.3 Using a for Loop with Embedded if Statements (Guards) - 使用具有嵌入式if语句的for循环(守卫语句) 4.4 Creating a New Collection from an Existing Collection with for/yield - 使用for/yield从现有集合创建新集合 4.5 Using the if Construct Like a Ternary Operator - 如三元运算符一样使用if结构 4.6 Using a Match Expression Like a switch Statement - 如switch语句一样使用match表达式 4.7 Matching Multiple Conditions with One Case Statement - 使用一个case语句匹配多个条件 4.8 Assigning the Result of a Match Expression to a Variable - 将match表达式的结果分配给变量 4.9 Accessing the Value of the Default Case in a Match Expression - 访问match表达式的缺省值 4.10 Using Pattern Matching in Match Expressions - 在match表达式中使用模式匹配 4.11 Using Enums and Case Classes in match Expressions - 在match表达式中使用枚举和样例类 4.12 Adding if Expressions (Guards) to Case Statements - 在case语句中添加if表达式(守卫语句) 4.13 Using a Match Expression Instead of isInstanceOf - 使用match表达式而不是isInstanceOf 4.14 Working with a List in a Match Expression - 在match表达式中使用列表 4.15 Matching One or More Exceptions with try/catch - 使用try/catch匹配一个或多个异常 4.16 Declaring a Variable Before Using It in a try/catch/finally Block - 在try/catch/finally块中使用变量之前先声明该变量 4.17 Creating Your Own Control Structures - 编写自己的控制结构
  4. Classes - 类 5.1 Choosing from Domain Modeling Options - 在多个领域建模的方法中挑选 5.2 Creating a Primary Constructor - 编写主构造函数 5.3 Controlling the Visibility of Constructor Fields - 构造函数字段的可见性 5.4 Defining Auxiliary Constructors for Classes - 定义类的辅助构造函数 5.5 Defining a Private Primary Constructor - 定义私有的主构造函数 5.6 Providing Default Values for Constructor Parameters - 为构造函数的参数提供默认值 5.7 Handling Constructor Parameters When Extending a Class - 继承类时构造函数的处理 5.8 Calling a Superclass Constructor - 调用父类的构造函数 5.9 Defining an equals Method (Object Equality) - 定义equals方法(对象等价性) 5.10 Preventing Accessor and Mutator Methods from Being Generated - 阻止访问方法和修改方法的生成 5.11 Overriding Default Accessors and Mutators - 覆盖默认的访问方法和修改方法 5.12 Assigning a Block or Function to a (lazy) Field - 将代码块或函数赋给一个(惰性)字段 5.13 Setting Uninitialized var Field Types - 设置未初始化的var字段的类型 5.14 Generating Boilerplate Code with Case Classes - 使用样例类生成模板代码 5.15 Defining Auxiliary Constructors for Case Classes - 为样例类定义辅助构造函数
  5. Traits and Enums - 特质和枚举 6.1 Using a Trait as an Interface - 将特质当作接口使用 6.2 Defining Abstract Fields in Traits - 在特质中定义抽象字段 6.3 Using a Trait Like an Abstract Class - 如抽象类一样使用特质 6.4 Using Traits as Mixins - 以混入的方式使用特质 6.5 Resolving Method Name Conflicts and Understanding super - 解决方法名称冲突并了解super关键字 6.6 Marking Traits So They Can Only Be Used by Subclasses of a Certain Type - 限制特质只可用于指定类型的子类 6.7 Ensuring a Trait Can Only Be Added to a Type That Has a Specific Method - 确保特质只能被添加到具有特定方法的类型中 6.8 Limiting Which Classes Can Use a Trait by Inheritance - 通过继承来限制哪些类可以使用特质 6.9 Working with Parameterized Traits - 使用参数化特质 6.10 Using Trait Parameters - 使用具有参数的特质 6.11 Using Traits to Create Modules - 使用特质创建模块 6.12 How to Create Sets of Named Values with Enums - 如何使用枚举创建命名值的集合 6.13 Modeling Algebraic Data Types with Enums - 使用枚举为代数数据类型建模
  6. Objects - 对象 7.1 Casting Objects - 对象的强制转换 7.2 Passing a Class Type with the classOf Method - 使用classOf方法获取类的class实例 7.3 Creating Singletons with object - 使用object创建单例 7.4 Creating Static Members with Companion Objects - 使用伴生对象创建静态成员 7.5 Using apply Methods in Objects as Constructors - 使用对象的apply方法创建实例 7.6 Implementing a Static Factory with apply - 使用apply实现静态工厂方法 7.7 Reifying Traits as Objects - 将特质具体化成对象 7.8 Implementing Pattern Matching with unapply - 使用unapply实现模式匹配
  7. Methods - 方法 8.1 Controlling Method Scope (Access Modifiers) - 控制方法作用域(访问修饰符) 8.2 Calling a Method on a Superclass or Trait - 调用父类或特质的方法 8.3 Using Parameter Names When Calling a Method - 使用方法的参数名 8.4 Setting Default Values for Method Parameters - 为方法参数设置默认值 8.5 Creating Methods That Take Variable-Argument Fields - 编写一个接受可变参数的方法 8.6 Forcing Callers to Leave Parentheses Off Accessor Methods - 强制调用方不使用括号调用方法 8.7 Declaring That a Method Can Throw an Exception - 声明方法能抛出的异常 8.8 Supporting a Fluent Style of Programming - 支持链式调用编码风格 8.9 Adding New Methods to Closed Classes with Extension Methods - 向封闭的类中添加扩展方法
  8. Packaging and Imports - 包和导入 9.1 Packaging with the Curly Braces Style Notation - 花括号风格的包语法 9.2 Importing One or More Members - 导入一个或多个成员 9.3 Renaming Members on Import - 在导入时重命名成员 9.4 Hiding a Class During the Import Process - 在导入时隐藏类 9.5 Importing Static Members - 导入静态成员 9.6 Using Import Statements Anywhere - 在任何地方使用导入语句 9.7 Importing Givens - 导入given
  9. Functional Programming - 函数式编程 10.1 Using Function Literals (Anonymous Functions) - 使用函数字面量(匿名函数) 10.2 Passing Functions Around as Variables - 将函数作为变量传递 10.3 Defining a Method That Accepts a Simple Function Parameter - 定义一个接受简单函数作为参数的方法 10.4 Declaring More Complex Higher-Order Functions - 声明更复杂的高阶函数 10.5 Using Partially Applied Functions - 使用部分应用函数 10.6 Creating a Method That Returns a Function - 编写返回函数的方法 10.7 Creating Partial Functions - 使用偏函数 10.8 Implementing Functional Error Handling - 实现函数式的错误处理 10.9 Real-World Example: Passing Functions Around in an Algorithm - 实际应用中的例子:在算法中传递函数 10.10 Real-World Example: Functional Domain Modeling - 实际应用中的例子:函数式领域建模
  10. Collections: Introduction - 集合:介绍 11.1 Choosing a Collections Class - 选择一个集合类 11.2 Understanding the Performance of Collections - 了解集合的性能概要 11.3 Understanding Mutable Variables with Immutable Collections - 使用不可变集合来理解可变变量 11.4 Creating a Lazy View on a Collection - 在集合上创建惰性视图
  11. Collections: Common Sequence Classes - 集合:常见序列类 12.1 Making Vector Your Go-To Immutable Sequence - 让Vector成为首选的不可变序列 12.2 Creating and Populating a List - 创建并填充List 12.3 Adding Elements to a List - 向List中添加元素 12.4 Deleting Elements from a List (or ListBuffer) - 从List(或ListBuffer)中删除元素 12.5 Creating a Mutable List with ListBuffer - 使用ListBuffer创建可变列表 12.6 Using LazyList, a Lazy Version of a List - 使用LazyList 12.7 Making ArrayBuffer Your Go-To Mutable Sequence - 让ArrayBuffer作为首选的可变序列 12.8 Deleting Array and ArrayBuffer Elements - 从Array和ArrayBuffer中删除元素 12.9 Creating and Updating an Array - 创建并修改Array 12.10 Creating Multidimensional Arrays - 创建多维数组 12.11 Sorting Arrays - 数组的排序
  12. Collections: Common Sequence Methods - 集合:常见序列方法 13.1 Choosing a Collection Method to Solve a Problem - 选择集合方法解决问题 13.2 Looping Over a Collection with foreach - 使用foreach遍历集合 13.3 Using Iterators - 使用迭代器 13.4 Using zipWithIndex or zip to Create Loop Counters - 使用zipWithIndex或者zip创建循环计数器 13.5 Transforming One Collection to Another with map - 使用map实现集合的转换 13.6 Flattening a List of Lists with flatten - 使用flatten对列表进行扁平化处理 13.7 Using filter to Filter a Collection - 使用filter对列表进行过滤 13.8 Extracting a Sequence of Elements from a Collection - 从集合中提取元素序列 13.9 Splitting Sequences into Subsets - 将序列拆分成子集 13.10 Walking Through a Collection with the reduce and fold Methods - 用reduce和fold方法遍历集合 13.11 Finding the Unique Elements in a Sequence - 从序列中查找不重复的元素 13.12 Merging Sequential Collections - 合并序列集合 13.13 Randomizing a Sequence - 随机化一个序列 13.14 Sorting a Collection - 集合的排序 13.15 Converting a Collection to a String with mkString and addString - 使用mkString和addString将集合转换为字符串
  13. Collections: Using Maps - 集合:Map的使用 14.1 Creating and Using Maps - 创建并使用Map 14.2 Choosing a Map Implementation - 选择一种Map实现 14.3 Adding, Updating, and Removing Immutable Map Elements - 在不可变Map中添加、更新或删除元素 14.4 Adding, Updating, and Removing Elements in Mutable Maps - 在可变Map中添加、更新或删除元素 14.5 Accessing Map Values (Without Exceptions) - 访问Map的值(避免异常) 14.6 Testing for the Existence of a Key or Value in a Map - 判断Map中键或值是否存在 14.7 Getting the Keys or Values from a Map - 获取Map的所有的键或值 14.8 Finding the Largest (or Smallest) Key or Value in a Map - 在Map中寻找最大(或最小)的键或值 14.9 Traversing a Map - 遍历Map 14.10 Sorting an Existing Map by Key or Value - 根据键或值对Map排序 14.11 Filtering a Map - 过滤Map
  14. Collections: Tuple, Range, Set, Stack, and Queue - 集合:Tuple、Range、Set、Stack和Queue 15.1 Creating Heterogeneous Lists with Tuples - 使用元组创建异构列表 15.2 Creating Ranges - 使用Range 15.3 Creating a Set and Adding Elements to It - 创建一个Set并添加元素 15.4 Deleting Elements from Sets - 删除Set中的元素 15.5 Storing Values in a Set in Sorted Order - 按排序顺序在Set中存储值 15.6 Creating and Using a Stack - 创建并使用栈 15.7 Creating and Using a Queue - 创建并使用队列
  15. Files and Processes - 文件和进程 16.1 Reading Text Files - 读取文本文件 16.2 Writing Text Files - 写入文本文件 16.3 Reading and Writing Binary Files - 读写二进制文件 16.4 Pretending That a String Is a File - 将字符串伪装为文件 16.5 Serializing and Deserializing Objects to Files - 对象和文件间的序列化/反序列化 16.6 Listing Files in a Directory - 列出目录中的文件 16.7 Executing External Commands - 执行外部命令 16.8 Executing External Commands and Reading Their STDOUT - 执行外部命令并读取标准输出 16.9 Handling Both STDOUT and STDERR of Commands - 处理命令的标准输出和标准错误输出 16.10 Building a Pipeline of External Commands - 构建外部命令的管道
  16. Building Projects with sbt - 使用sbt构建项目 17.1 Creating a Project Directory Structure for sbt - 为sbt创建一个项目目录结构 17.2 Building Projects with the sbt Command - 使用sbt命令构建项目 17.3 Understanding build.sbt Syntax Styles - 了解build.sbt语法风格 17.4 Compiling, Running, and Packaging a Scala Project - 编译、运行并打包一个Scala项目 17.5 Understanding Other sbt Commands - 了解其他sbt命令 17.6 Continuous Compiling and Testing - 持续的编译和测试 17.7 Managing Dependencies with sbt - 使用sbt管理依赖 17.8 Controlling Which Version of a Managed Dependency Is Used - 控制托管依赖的版本 17.9 Generating Project API Documentation - 生成项目的API文档 17.10 Specifying a Main Class to Run with sbt - 指定使用sbt运行的主类 17.11 Deploying a Single Executable JAR File - 部署单个可执行的JAR文件 17.12 Publishing Your Library - 发布类库
  17. Concurrency with Scala Futures and Akka Actors - Scala Futures和Akka Actors的并发 18.1 Creating a Future - 使用Future 18.2 Using Callback and Transformation Methods with Futures - 使用Future的回调和转换方法 18.3 Writing Methods That Return Futures - 编写返回Future的方法 18.4 Running Multiple Futures in Parallel - 并行运行多个Future 18.5 Creating OOP-Style Actors - 编写面向对象风格的Actor 18.6 Creating FP-Style Actors - 编写函数式风格的Actor 18.7 Sending Messages to Actors - 向Actor发消息 18.8 Creating Actors That Have Multiple States (FSM) - 编写具有多种状态的Actor(FSM)
  18. Play Framework and Web Services - Play框架和Web服务 19.1 Creating a Play Framework Project - 创建使用Play框架的项目 19.2 Creating a New Play Framework Endpoint - 编写新的Play端点 19.3 Returning JSON from a GET Request with Play - 让Play的GET请求的返回JSON 19.4 Serializing a Scala Object to a JSON String - 将Scala对象序列化为JSON字符串 19.5 Deserializing JSON into a Scala Object - 将JSON反序列化成Scala对象 19.6 Using the Play JSON Library Outside of the Play Framework - 在非Play项目中使用Play JSON库 19.7 Using the sttp HTTP Client - 使用sttp HTTP客户端
  19. Apache Spark - Apache Spark 20.1 Getting Started with Spark - 开始使用Spark 20.2 Reading a File into a Spark RDD - 将文件读入Spark RDD 20.3 Reading a CSV File into a Spark RDD - 将CSV文件读入Spark RDD 20.4 Using Spark Like a Database with DataFrames - 如数据库一样使用Spark DataFrame 20.5 Reading Data Files into a Spark DataFrame - 将数据文件读入Spark DataFrame 20.6 Using Spark SQL Queries Against Multiple Files - 对多个文件使用Spark SQL查询 20.7 Creating a Spark Batch Application - 编写一个Spark批处理程序
  20. Scala.js, GraalVM, and jpackage - Scala.js、GraalVM和jpackage 21.1 Getting Started with Scala.js - 开始使用Scala.js 21.2 Responding to Events with Scala.js - 使用Scala.js响应事件 21.3 Building Single-Page Applications with Scala.js - 使用Scala.js构建单页面的应用程序 21.4 Building Native Executables with GraalVM - 使用GraalVM构建本地可执行文件 21.5 Bundling Your Application with jpackage - 使用jpackage打包应用程序
  21. Integrating Scala with Java - Scala与Java集成 22.1 Using Java Collections in Scala - 在Scala中使用Java的集合 22.2 Using Scala Collections in Java - 在Java中使用Scala的集合 22.3 Using Java Optional Values in Scala - 在Scala中使用Java的Optional值 22.4 Using Scala Option Values in Java - 在Java中使用Scala的Option值 22.5 Using Scala Traits in Java - 在Java中使用Scala的特质 22.6 Using Java Interfaces in Scala - 在Scala中使用Java的接口 22.7 Adding Exception Annotations to Scala Methods - 为Scala方法添加异常注解 22.8 Annotating varargs Methods to Work with Java - 为varargs方法添加注解以便Java代码使用 22.9 Using @SerialVersionUID and Other Annotations - 使用@SerialVersionUID和其他注解
  22. Types - 类型 23.1 Creating a Method That Takes a Simple Generic Type - 编写一个接受简单泛型类型参数的方法 23.2 Creating Classes That Use Simple Generic Types - 编写一个使用简单的泛型类型的类 23.3 Making Immutable Generic Parameters Covariant - 将不可变的泛型参数改为协变 23.4 Creating a Class Whose Generic Elements Can Be Mutated - 编写一个元素类型可以变化的类 23.5 Creating a Class Whose Parameters Implement a Base Type - 编写一个参数实现了基类型的类 23.6 Using Duck Typing (Structural Types) - 使用Duck类型(结构化类型) 23.7 Creating Meaningful Type Names with Opaque Types - 使用不透明类型创建有意义的类型名称 23.8 Using Term Inference with given and using - 使用given和using的术语推断 23.9 Simulating Dynamic Typing with Union Types - 使用联合类型模拟动态类型 23.10 Declaring That a Value Is a Combination of Types - 声明一个多种类型的组合的值 23.11 Controlling How Classes Can Be Compared with Multiversal Equality - 控制类如何使用多元等价进行比较 23.12 Limiting Equality Comparisons with the CanEqual Typeclass - 使用CanEqual类型类限制等价比较
  23. Best Practices - 最佳实践 24.1 Writing Pure Functions - 编写纯函数 24.2 Using Immutable Variables and Collections - 使用不可变变量和集合 24.3 Writing Expressions (Instead of Statements) - 编写表达式(而不是语句) 24.4 Using Match Expressions and Pattern Matching - 使用match表达式和模式匹配 24.5 Eliminating null Values from Your Code - 消除代码中的null值 24.6 Using Scala’s Error-Handling Types (Option, Try, and Either) - 使用Scala的错误处理类型(Option、Try和Either) 24.7 Building Modular Systems - 构建模块化系统 24.8 Handling Option Values with Higher-Order Functions - 使用高阶函数处理Option值~~
jxnu-liguobin commented 2 years ago

待本issue定稿后我们同步到WPS @IceMimosa

IceMimosa commented 2 years ago

第一章

第二章

第三章

第四章

第五章

第六章

并行关系又要一点关联的可以使用「与」

第七章

第八章

尽可能省略章节里面包含的「方法二字」

第九章

第十章

第十一章

第十二章

第十三章

第十四章

第十五章

第十六章

第十七章

第十八章

第十九章

第二十章

第二十一章

第二十二章

第二十三章

第二十四章

jxnu-liguobin commented 2 years ago

draft 2

  1. Command-Line Tasks - 命令行 1.1 Getting Started with the Scala REPL - Scala REPL 1.2 Loading Source Code and JAR Files into the REPL - 将源代码和JAR文件加载进REPL 1.3 Getting Started with the Ammonite REPL - Ammonite REPL 1.4 Compiling with scalac and Running with scala - scalac和scala命令 1.5 Disassembling and Decompiling Scala Code - 反编译Scala代码 1.6 Running JAR Files with Scala and Java - 运行JAR文件
  2. Strings - 字符串 2.1 Testing String Equality - 字符串的相等性判断 2.2 Creating Multiline Strings - 多行字符串 2.3 Splitting Strings - 字符串的分割 2.4 Substituting Variables into Strings - 字符串的变量替换 2.5 Formatting String Output - 字符串的格式化 2.6 Processing a String One Character at a Time - 每次处理字符串的一个字符 2.7 Finding Patterns in Strings - 字符串的模式查找 2.8 Replacing Patterns in Strings - 字符串的模式替换 2.9 Extracting Parts of a String That Match Patterns - 使用模式提取字符串 2.10 Accessing a Character in a String - 访问字符串中的字符 2.11 Creating Your Own String Interpolator - 自定义字符串插值器 2.12 Creating Random Strings - 随机字符串
  3. Numbers and Dates - 数值和日期 3.1 Parsing a Number from a String - 将字符串解析为数值 3.2 Converting Between Numeric Types (Casting) - 数值类型间的转换 3.3 Overriding the Default Numeric Type - 覆盖默认的数值类型 3.4 Replacements for ++ and −− - ++和−−的替代方案 3.5 Comparing Floating-Point Numbers - 浮点数的比较 3.6 Handling Large Numbers - 大数值 3.7 Generating Random Numbers - 随机数 3.8 Formatting Numbers and Currency - 数值和货币的格式化 3.9 Creating New Date and Time Instances - 全新的日期和时间API 3.10 Calculating the Difference Between Two Dates - 计算日期的差值 3.11 Formatting Dates - 日期的格式化 3.12 Parsing Strings into Dates - 将字符串解析为日期
  4. Control Structures - 控制结构 4.1 Looping over Data Structures with for - for循环 4.2 Using for Loops with Multiple Counters - 具有多个计数器的for循环 4.3 Using a for Loop with Embedded if Statements (Guards) - 具有嵌入式if语句的for循环(守卫语句) 4.4 Creating a New Collection from an Existing Collection with for/yield - 集合中的for/yield 4.5 Using the if Construct Like a Ternary Operator - if/then/else 4.6 Using a Match Expression Like a switch Statement - match表达式 4.7 Matching Multiple Conditions with One Case Statement - case语句 4.8 Assigning the Result of a Match Expression to a Variable - 使用match表达式的结果 4.9 Accessing the Value of the Default Case in a Match Expression - 访问match表达式的缺省值 4.10 Using Pattern Matching in Match Expressions - match表达式与模式匹配 4.11 Using Enums and Case Classes in match Expressions - match表达式与枚举和样例类 4.12 Adding if Expressions (Guards) to Case Statements - case语句与if表达式(守卫) 4.13 Using a Match Expression Instead of isInstanceOf - match表达式与isInstanceOf 4.14 Working with a List in a Match Expression - match表达式与List 4.15 Matching One or More Exceptions with try/catch - try/catch 4.16 Declaring a Variable Before Using It in a try/catch/finally Block - try/catch/finally 4.17 Creating Your Own Control Structures - 自定义控制结构
  5. Classes - 类 5.1 Choosing from Domain Modeling Options - 如何选中领域建模的工具 5.2 Creating a Primary Constructor - 主构造函数 5.3 Controlling the Visibility of Constructor Fields - 构造函数字段的可见性 5.4 Defining Auxiliary Constructors for Classes - 辅助构造函数 5.5 Defining a Private Primary Constructor - 私有的主构造函数 5.6 Providing Default Values for Constructor Parameters - 构造函数参数的默认值 5.7 Handling Constructor Parameters When Extending a Class - 类继承时的构造函数 5.8 Calling a Superclass Constructor - 调用父类的构造函数 5.9 Defining an equals Method (Object Equality) - equals方法(对象等价性) 5.10 Preventing Accessor and Mutator Methods from Being Generated - 阻止生成访问方法和修改方法 5.11 Overriding Default Accessors and Mutators - 覆盖默认的访问方法和修改方法 5.12 Assigning a Block or Function to a (lazy) Field - 惰性字段 5.13 Setting Uninitialized var Field Types - 未初始化的var字段 5.14 Generating Boilerplate Code with Case Classes - 样例类的模板代码 5.15 Defining Auxiliary Constructors for Case Classes - 样例类的辅助构造函数
  6. Traits and Enums - 特质和枚举 6.1 Using a Trait as an Interface - 将特质当作接口 6.2 Defining Abstract Fields in Traits - 特质的抽象字段 6.3 Using a Trait Like an Abstract Class - 将特质当作抽象类 6.4 Using Traits as Mixins - 以混入的方式使用特质 6.5 Resolving Method Name Conflicts and Understanding super - 方法名称与super关键字 6.6 Marking Traits So They Can Only Be Used by Subclasses of a Certain Type - 限制特质的拓展(仅支持特定类型的子类) 6.7 Ensuring a Trait Can Only Be Added to a Type That Has a Specific Method - 限制特质的拓展(仅支持具有特定方法的类型) 6.8 Limiting Which Classes Can Use a Trait by Inheritance - 限制特质的拓展(仅支持特定的类) 6.9 Working with Parameterized Traits - 参数化特质 6.10 Using Trait Parameters - 具有参数的特质 6.11 Using Traits to Create Modules - 特质与模块 6.12 How to Create Sets of Named Values with Enums - 命名值的集合 6.13 Modeling Algebraic Data Types with Enums - 代数数据类型建模
  7. Objects - 对象 7.1 Casting Objects - 对象的强制转换 7.2 Passing a Class Type with the classOf Method - classOf方法 7.3 Creating Singletons with object - 单例对象 7.4 Creating Static Members with Companion Objects - 伴生对象的静态成员 7.5 Using apply Methods in Objects as Constructors - apply方法 7.6 Implementing a Static Factory with apply - apply方法与静态工厂 7.7 Reifying Traits as Objects - 将特质具体化成对象 7.8 Implementing Pattern Matching with unapply - unapply方法与模式匹配
  8. Methods - 方法 8.1 Controlling Method Scope (Access Modifiers) - 作用域(访问修饰符) 8.2 Calling a Method on a Superclass or Trait - 调用父类或特质的方法 8.3 Using Parameter Names When Calling a Method - 命名参数 8.4 Setting Default Values for Method Parameters - 参数的默认值 8.5 Creating Methods That Take Variable-Argument Fields - 可变参数 8.6 Forcing Callers to Leave Parentheses Off Accessor Methods - 无括号的方法调用 8.7 Declaring That a Method Can Throw an Exception - 声明异常 8.8 Supporting a Fluent Style of Programming - 链式调用风格 8.9 Adding New Methods to Closed Classes with Extension Methods - 扩展方法
  9. Packaging and Imports - 包和导入 9.1 Packaging with the Curly Braces Style Notation - 花括号风格的包语法 9.2 Importing One or More Members - 导入一个或多个成员 9.3 Renaming Members on Import - 导入并重命名成员 9.4 Hiding a Class During the Import Process - 导入时隐藏类 9.5 Importing Static Members - 导入静态成员 9.6 Using Import Statements Anywhere - 无处不在的导入语句 9.7 Importing Givens - 导入given
  10. Functional Programming - 函数式编程 10.1 Using Function Literals (Anonymous Functions) - 函数字面量(匿名函数) 10.2 Passing Functions Around as Variables - 将函数作为变量传递 10.3 Defining a Method That Accepts a Simple Function Parameter - 以函数作为参数的方法 10.4 Declaring More Complex Higher-Order Functions - 高阶函数 10.5 Using Partially Applied Functions - 部分应用函数 10.6 Creating a Method That Returns a Function - 返回函数的方法 10.7 Creating Partial Functions - 偏函数 10.8 Implementing Functional Error Handling - 函数式的错误处理 10.9 Real-World Example: Passing Functions Around in an Algorithm - 实际应用中的例子:在算法中传递函数 10.10 Real-World Example: Functional Domain Modeling - 实际应用中的例子:函数式领域建模
  11. Collections: Introduction - 集合:介绍 11.1 Choosing a Collections Class - 如何选择集合类 11.2 Understanding the Performance of Collections - 集合的性能概要 11.3 Understanding Mutable Variables with Immutable Collections - 不可变集合与可变变量 11.4 Creating a Lazy View on a Collection - 惰性视图
  12. Collections: Common Sequence Classes - 集合:常见序列类 12.1 Making Vector Your Go-To Immutable Sequence - 首选的不可变序列 12.2 Creating and Populating a List - List 12.3 Adding Elements to a List - List的添加操作 12.4 Deleting Elements from a List (or ListBuffer) - List(或ListBuffer)的删除操作 12.5 Creating a Mutable List with ListBuffer - ListBuffer 12.6 Using LazyList, a Lazy Version of a List - LazyList 12.7 Making ArrayBuffer Your Go-To Mutable Sequence - 首选的可变序列 12.8 Deleting Array and ArrayBuffer Elements - Array和ArrayBuffer的删除操作 12.9 Creating and Updating an Array - Array 12.10 Creating Multidimensional Arrays - 多维数组 12.11 Sorting Arrays - 数组的排序
  13. Collections: Common Sequence Methods - 集合:常见序列方法 13.1 Choosing a Collection Method to Solve a Problem - 如何选择集合方法 13.2 Looping Over a Collection with foreach - foreach遍历 13.3 Using Iterators - 迭代器 13.4 Using zipWithIndex or zip to Create Loop Counters - zipWithIndex和zip方法 13.5 Transforming One Collection to Another with map - map 13.6 Flattening a List of Lists with flatten - flatten 13.7 Using filter to Filter a Collection - filter 13.8 Extracting a Sequence of Elements from a Collection - 提取元素序列 13.9 Splitting Sequences into Subsets - 序列的拆分 13.10 Walking Through a Collection with the reduce and fold Methods - reduce和fold方法 13.11 Finding the Unique Elements in a Sequence - 查找序列中的唯一元素 13.12 Merging Sequential Collections - 合并序列 13.13 Randomizing a Sequence - 随机生产一个序列 13.14 Sorting a Collection - 集合的排序 13.15 Converting a Collection to a String with mkString and addString - mkString和addString方法
  14. Collections: Using Maps - 集合:Map的使用 14.1 Creating and Using Maps - Map 14.2 Choosing a Map Implementation - 如何选择Map 14.3 Adding, Updating, and Removing Immutable Map Elements - 不可变Map的添加、更新或删除操作 14.4 Adding, Updating, and Removing Elements in Mutable Maps - 可变Map的添加、更新或删除操作 14.5 Accessing Map Values (Without Exceptions) - 访问Map的值(避免异常) 14.6 Testing for the Existence of a Key or Value in a Map - 判断Map中键或值是否存在 14.7 Getting the Keys or Values from a Map - 获取Map的所有的键或值 14.8 Finding the Largest (or Smallest) Key or Value in a Map - 寻找Map中最大(或最小)的键或值 14.9 Traversing a Map - 遍历Map 14.10 Sorting an Existing Map by Key or Value - 根据键或值对Map排序 14.11 Filtering a Map - 过滤Map
  15. Collections: Tuple, Range, Set, Stack, and Queue - 集合:Tuple、Range、Set、Stack和Queue 15.1 Creating Heterogeneous Lists with Tuples - 元组与异构列表 15.2 Creating Ranges - Range 15.3 Creating a Set and Adding Elements to It - Set 15.4 Deleting Elements from Sets - Set的删除操作 15.5 Storing Values in a Set in Sorted Order - 有序Set 15.6 Creating and Using a Stack - 栈 15.7 Creating and Using a Queue - 队列
  16. Files and Processes - 文件和进程 16.1 Reading Text Files - 读取文本文件 16.2 Writing Text Files - 写入文本文件 16.3 Reading and Writing Binary Files - 读写二进制文件 16.4 Pretending That a String Is a File - 将字符串伪装为文件 16.5 Serializing and Deserializing Objects to Files - 对象和文件间的序列化/反序列化 16.6 Listing Files in a Directory - 列出目录中的文件 16.7 Executing External Commands - 执行外部命令 16.8 Executing External Commands and Reading Their STDOUT - 执行外部命令并读取标准输出 16.9 Handling Both STDOUT and STDERR of Commands - 命令的标准输出和标准错误输出 16.10 Building a Pipeline of External Commands - 构建外部命令的管道
  17. Building Projects with sbt - 使用sbt构建项目 17.1 Creating a Project Directory Structure for sbt - 使用sbt创建项目 17.2 Building Projects with the sbt Command - 使用sbt命令构建项目 17.3 Understanding build.sbt Syntax Styles - build.sbt文件的语法 17.4 Compiling, Running, and Packaging a Scala Project - 编译、运行和打包 17.5 Understanding Other sbt Commands - 其他命令 17.6 Continuous Compiling and Testing - 持续的编译和测试 17.7 Managing Dependencies with sbt - 管理依赖 17.8 Controlling Which Version of a Managed Dependency Is Used - 控制托管依赖的版本 17.9 Generating Project API Documentation - 生成项目的API文档 17.10 Specifying a Main Class to Run with sbt - 指定使用sbt运行的主类 17.11 Deploying a Single Executable JAR File - 部署可执行JAR文件 17.12 Publishing Your Library - 发布类库
  18. Concurrency with Scala Futures and Akka Actors - Scala Futures和Akka Actors的并发 18.1 Creating a Future - Future 18.2 Using Callback and Transformation Methods with Futures - Future的回调和转换方法 18.3 Writing Methods That Return Futures - 返回Future的方法 18.4 Running Multiple Futures in Parallel - 并行运行多个Future 18.5 Creating OOP-Style Actors - 面向对象风格的Actor 18.6 Creating FP-Style Actors - 函数式风格的Actor 18.7 Sending Messages to Actors - 向Actor发消息 18.8 Creating Actors That Have Multiple States (FSM) - 具有多种状态的Actor(FSM)
  19. Play Framework and Web Services - Play框架和Web服务 19.1 Creating a Play Framework Project - 创建基于Play的项目 19.2 Creating a New Play Framework Endpoint - 编写新Play端点 19.3 Returning JSON from a GET Request with Play - 返回JSON的GET请求 19.4 Serializing a Scala Object to a JSON String - 将Scala对象序列化为JSON字符串 19.5 Deserializing JSON into a Scala Object - 将JSON反序列化成Scala对象 19.6 Using the Play JSON Library Outside of the Play Framework - 在非Play项目中使用Play JSON库 19.7 Using the sttp HTTP Client - sttp HTTP客户端
  20. Apache Spark - Apache Spark 20.1 Getting Started with Spark - Spark 20.2 Reading a File into a Spark RDD - 将文件读入Spark RDD 20.3 Reading a CSV File into a Spark RDD - 将CSV文件读入Spark RDD 20.4 Using Spark Like a Database with DataFrames - 如数据库一样使用Spark DataFrame 20.5 Reading Data Files into a Spark DataFrame - 将数据文件读入Spark DataFrame 20.6 Using Spark SQL Queries Against Multiple Files - 对多个文件使用Spark SQL查询 20.7 Creating a Spark Batch Application - Spark批处理程序
  21. Scala.js, GraalVM, and jpackage - Scala.js、GraalVM和jpackage 21.1 Getting Started with Scala.js - Scala.js 21.2 Responding to Events with Scala.js - 响应事件 21.3 Building Single-Page Applications with Scala.js - 构建单页面的应用程序 21.4 Building Native Executables with GraalVM - 使用GraalVM构建本地可执行文件 21.5 Bundling Your Application with jpackage - 使用jpackage打包
  22. Integrating Scala with Java - Scala与Java集成 22.1 Using Java Collections in Scala - 在Scala中使用Java的集合 22.2 Using Scala Collections in Java - 在Java中使用Scala的集合 22.3 Using Java Optional Values in Scala - 在Scala中使用Java的Optional值 22.4 Using Scala Option Values in Java - 在Java中使用Scala的Option值 22.5 Using Scala Traits in Java - 在Java中使用Scala的特质 22.6 Using Java Interfaces in Scala - 在Scala中使用Java的接口 22.7 Adding Exception Annotations to Scala Methods - 异常注解 22.8 Annotating varargs Methods to Work with Java - 可变参数如何被Java使用 22.9 Using @serialversionuid and Other Annotations - @serialversionuid和其他注解
  23. Types - 类型 23.1 Creating a Method That Takes a Simple Generic Type - 参数是泛型类型的方法 23.2 Creating Classes That Use Simple Generic Types - 具有泛型类型的类 23.3 Making Immutable Generic Parameters Covariant - 不可变和协变的泛型参数 23.4 Creating a Class Whose Generic Elements Can Be Mutated - 元素类型可变化的类 23.5 Creating a Class Whose Parameters Implement a Base Type - 类的泛型类型边界 23.6 Using Duck Typing (Structural Types) - Duck类型(结构化类型) 23.7 Creating Meaningful Type Names with Opaque Types - 不透明类型与类型名称 23.8 Using Term Inference with given and using - given和using的术语推断 23.9 Simulating Dynamic Typing with Union Types - 联合类型与动态类型 23.10 Declaring That a Value Is a Combination of Types - 类型的组合 23.11 Controlling How Classes Can Be Compared with Multiversal Equality - 通过多元等价比较类 23.12 Limiting Equality Comparisons with the CanEqual Typeclass - CanEqual类型类
  24. Best Practices - 最佳实践 24.1 Writing Pure Functions - 纯函数 24.2 Using Immutable Variables and Collections - 不可变量与集合 24.3 Writing Expressions (Instead of Statements) - 表达式(而不是语句) 24.4 Using Match Expressions and Pattern Matching - match表达式与模式匹配 24.5 Eliminating null Values from Your Code - 消除null值 24.6 Using Scala’s Error-Handling Types (Option, Try, and Either) - Scala的错误处理类型(Option、Try和Either) 24.7 Building Modular Systems - 构建模块化系统 24.8 Handling Option Values with Higher-Order Functions - 高阶函数与Option

并列且有关系的用(前因后果,英文中的 use x to xx),无关系用

xiaozhiliaoo commented 2 years ago

3.5 Comparing Floating-Point Numbers - 浮点数的比较 3.6 Handling Large Numbers - 处理大数字 3.7 Generating Random Numbers - 随机数 3.8 Formatting Numbers and Currency - 数值和货币的格式化

3.7是随机数的生成?Generating 去掉感觉有点奇怪。

jxnu-liguobin commented 2 years ago
  1. 标题尽可能为名词,关键词,容易理解的术语,一看标题就能猜到内容,而不是把内容、原因、原理写在标题。
zhuqingchao commented 2 years ago

1.2 Loading Source Code and JAR Files into the REPL - 在REPL中使用源代码和 JAR 文件 2.6 Processing a String One Character at a Time - 字符串字符迭代 2.7 Finding Patterns in Strings - 字符串的匹配模式 2.8 Replacing Patterns in Strings - 字符串替换/字符串替换模式 2.9 Extracting Parts of a String That Match Patterns - 使用模式匹配提取字符串 3.9 Creating New Date and Time Instances - 日期和时间 4.5 Using the if Construct Like a Ternary Operator - "三元操作符"/ Scala 中的"三元操作符" 4.7 Matching Multiple Conditions with One Case Statement - 多条件case匹配 4.12 Adding if Expressions (Guards) to Case Statements - case语句与模式守卫 5.1 Choosing from Domain Modeling Options - 如何挑选合适的领域建模工具 6.5 Resolving Method Name Conflicts and Understanding super - 多特质同名方法处理与super关键字 6.6 Marking Traits So They Can Only Be Used by Subclasses of a Certain Type - 自类型 6.7 Ensuring a Trait Can Only Be Added to a Type That Has a Specific Method - (STRUCTURAL TYPES 的官方翻译是啥?) 结构化类型? 12.5 Creating a Mutable List with ListBuffer - 可变序列ListBuffer 12.9 Creating and Updating an Array - 数组 12.11 Sorting Arrays - 数组排序 17.7 Managing Dependencies with sbt - 依赖管理 17.8 Controlling Which Version of a Managed Dependency Is Used - 依赖的版本控制 23.1 Creating a Method That Takes a Simple Generic Type - 泛型方法 23.2 Creating Classes That Use Simple Generic Types - 泛型类 23.3 Making Immutable Generic Parameters Covariant - 不可变泛型参数的协变

jxnu-liguobin commented 2 years ago

1.2 Loading Source Code and JAR Files into the REPL - 在REPL中使用源代码和 JAR 文件 2.6 Processing a String One Character at a Time - 字符串字符迭代 => 待定,迭代一般是迭代器的 没找到更合适, 2.7 Finding Patterns in Strings - 字符串的匹配模式 => 待定,我和陈凯认为 字符串的模式查找 更好,重点是模式, 2.8 Replacing Patterns in Strings - 字符串替换/字符串替换模式 => 待定,我和陈凯认为 字符串的模式替换 更好,重点是模式 2.9 Extracting Parts of a String That Match Patterns - 使用模式匹配提取字符串 => ok 3.9 Creating New Date and Time Instances - 日期和时间 => ok 4.5 Using the if Construct Like a Ternary Operator - "三元操作符"/ Scala 中的"三元操作符" => Scala 中的“三元操作符(三目运算符)“ 4.7 Matching Multiple Conditions with One Case Statement - 多条件case匹配 => ok 4.12 Adding if Expressions (Guards) to Case Statements - case语句与模式守卫 => 待定 5.1 Choosing from Domain Modeling Options - 如何挑选合适的领域建模工具 => ok 6.5 Resolving Method Name Conflicts and Understanding super - 多特质同名方法处理与super关键字 => ok 6.6 Marking Traits So They Can Only Be Used by Subclasses of a Certain Type - 自类型 => 这个无论是selftype还是翻译自类型,都很难说容易阅读,这里使用限定特质的拓展更容易理解,先待定 6.7 Ensuring a Trait Can Only Be Added to a Type That Has a Specific Method - (STRUCTURAL TYPES 的官方翻译是啥?) 结构化类型?=> 3新增的应该是没有的,。根据维基和大数据的结构化数据,结构化类型是可以说得通,。

12.5 Creating a Mutable List with ListBuffer - 可变序列ListBuffer => 待定 12.9 Creating and Updating an Array - 数组 => ok 12.11 Sorting Arrays - 数组排序 => ok 17.7 Managing Dependencies with sbt - 依赖管理 => ok 17.8 Controlling Which Version of a Managed Dependency Is Used - 依赖的版本控制 => 托管依赖的版本控制 (非托管依赖是直接用jar,术语来自sbt官网 23.1 Creating a Method That Takes a Simple Generic Type - 泛型方法 => ok 23.2 Creating Classes That Use Simple Generic Types - 泛型类 => ok 23.3 Making Immutable Generic Parameters Covariant - 不可变泛型参数的协变 => 待定

zhuqingchao commented 2 years ago

2.7、2.8 是突出模式。 只是 模式 放前放后的区别。 4.12 这里的 if 表达式应该就是守卫模式吧。 所以我理解这个可以是 case语句与模式守卫。 6.6 selfType 算是 scala 里通用概念了, 我觉得需要放出来。原文这段就是讲 selfType。 其他均可,只是参考。

jxnu-liguobin commented 2 years ago

2.7、2.8 是突出模式。 只是 模式 放前放后的区别。

前后有区别的,可能个人感觉不同 我是这样理解的:字符串的模式查找 实际上是 字符串中的按模式的查找 而不是 字符串中的查找的模式

4.12 这里的 if 表达式应该就是守卫模式吧。 所以我理解这个可以是 case语句与模式守卫。

这里待定是因为for中有if守卫,所以问题在于,match的if守卫和for if守卫是否可以为一种描述

6.6 selfType 算是 scala 里通用概念了, 我觉得需要放出来。原文这段就是讲 selfType

这个不能以自己角度看的,使用cookbook的人可能从未用过selftype,这样当他需要限定类型就找不到章节。更重要的是selftype不具有自解释性,比如联合类型 是自解释的,其他语言中有的 字面上就能被人理解。

jxnu-liguobin commented 2 years ago

draft 3

  1. Command-Line Tasks - 命令行 1.1 Getting Started with the Scala REPL - 初识Scala REPL 1.2 Loading Source Code and JAR Files into the REPL - 在REPL中使用源代码和JAR文件 1.3 Getting Started with the Ammonite REPL - 初识Ammonite REPL 1.4 Compiling with scalac and Running with scala - scalac和scala命令 1.5 Disassembling and Decompiling Scala Code - 反编译Scala代码 1.6 Running JAR Files with Scala and Java - 运行JAR文件
  2. Strings - 字符串 2.1 Testing String Equality - 字符串的相等性判断 2.2 Creating Multiline Strings - 多行字符串 2.3 Splitting Strings - 字符串的分割 2.4 Substituting Variables into Strings - 字符串的变量代入 2.5 Formatting String Output - 字符串的格式化 2.6 Processing a String One Character at a Time - 字符串的逐个字符处理 2.7 Finding Patterns in Strings - 字符串的模式查找 2.8 Replacing Patterns in Strings - 字符串的模式替换 2.9 Extracting Parts of a String That Match Patterns - 使用模式匹配提取字符串 2.10 Accessing a Character in a String - 访问单个字符 2.11 Creating Your Own String Interpolator - 自定义字符串插值器 2.12 Creating Random Strings - 随机字符串
  3. Numbers and Dates - 数值和日期 3.1 Parsing a Number from a String - 将字符串解析为数值 3.2 Converting Between Numeric Types (Casting) - 数值类型间的转换 3.3 Overriding the Default Numeric Type - 覆盖默认的数值类型 3.4 Replacements for ++ and −− - ++和−−的替代方案 3.5 Comparing Floating-Point Numbers - 浮点数的比较 3.6 Handling Large Numbers - 大数值 3.7 Generating Random Numbers - 随机数 3.8 Formatting Numbers and Currency - 数值和货币的格式化 3.9 Creating New Date and Time Instances - 日期和时间 3.10 Calculating the Difference Between Two Dates - 计算日期的差值 3.11 Formatting Dates - 日期的格式化 3.12 Parsing Strings into Dates - 将字符串解析为日期
  4. Control Structures - 控制结构 4.1 Looping over Data Structures with for - for循环 4.2 Using for Loops with Multiple Counters - 多重for循环 4.3 Using a for Loop with Embedded if Statements (Guards) - for循环中的守卫语句 4.4 Creating a New Collection from an Existing Collection with for/yield - 集合中的for/yield 4.5 Using the if Construct Like a Ternary Operator - Scala 中的“三元操作符(三目运算符)“ 4.6 Using a Match Expression Like a switch Statement - match表达式 4.7 Matching Multiple Conditions with One Case Statement - case的多条件匹配 4.8 Assigning the Result of a Match Expression to a Variable - match表达式的结果 4.9 Accessing the Value of the Default Case in a Match Expression - match表达式的缺省值 4.10 Using Pattern Matching in Match Expressions - match表达式与模式匹配 4.11 Using Enums and Case Classes in match Expressions - match表达式与枚举和样例类 4.12 Adding if Expressions (Guards) to Case Statements - case中的守卫语句 4.13 Using a Match Expression Instead of isInstanceOf - match表达式与isInstanceOf 4.14 Working with a List in a Match Expression - match表达式与List 4.15 Matching One or More Exceptions with try/catch - try/catch 4.16 Declaring a Variable Before Using It in a try/catch/finally Block - try/catch/finally 4.17 Creating Your Own Control Structures - 自定义控制结构
  5. Classes - 类 5.1 Choosing from Domain Modeling Options - 挑选合适的领域建模工具 5.2 Creating a Primary Constructor - 主构造函数 5.3 Controlling the Visibility of Constructor Fields - 构造函数字段的可见性 5.4 Defining Auxiliary Constructors for Classes - 辅助构造函数 5.5 Defining a Private Primary Constructor - 私有的主构造函数 5.6 Providing Default Values for Constructor Parameters - 构造函数参数的默认值 5.7 Handling Constructor Parameters When Extending a Class - 类继承时的构造函数 5.8 Calling a Superclass Constructor - 调用父类的构造函数 5.9 Defining an equals Method (Object Equality) - equals方法(对象等价性) 5.10 Preventing Accessor and Mutator Methods from Being Generated - 阻止生成访问方法和修改方法 5.11 Overriding Default Accessors and Mutators - 覆盖默认的访问方法和修改方法 5.12 Assigning a Block or Function to a (lazy) Field - 惰性字段 5.13 Setting Uninitialized var Field Types - 未初始化的var字段 5.14 Generating Boilerplate Code with Case Classes - 样例类产生的模板代码 5.15 Defining Auxiliary Constructors for Case Classes - 样例类的辅助构造函数
  6. Traits and Enums - 特质和枚举 6.1 Using a Trait as an Interface - 特质的接口用法 6.2 Defining Abstract Fields in Traits - 特质的抽象字段 6.3 Using a Trait Like an Abstract Class - 特质的抽象类用法 6.4 Using Traits as Mixins - 特质的混入用法 6.5 Resolving Method Name Conflicts and Understanding super - 多特质同名方法处理与super关键字 6.6 Marking Traits So They Can Only Be Used by Subclasses of a Certain Type - 限制特质的拓展(仅支持特定类型的子类) 6.7 Ensuring a Trait Can Only Be Added to a Type That Has a Specific Method - 限制特质的拓展(仅支持具有特定方法的类型) 6.8 Limiting Which Classes Can Use a Trait by Inheritance - 限制特质的拓展(仅支持特定的类) 6.9 Working with Parameterized Traits - 参数化特质 6.10 Using Trait Parameters - 特质的构造函数 6.11 Using Traits to Create Modules - 特质与模块 6.12 How to Create Sets of Named Values with Enums - 命名值的集合 6.13 Modeling Algebraic Data Types with Enums - ADTs建模
  7. Objects - 对象 7.1 Casting Objects - 对象的强制转换 7.2 Passing a Class Type with the classOf Method - classOf方法 7.3 Creating Singletons with object - 单例对象 7.4 Creating Static Members with Companion Objects - 伴生对象的静态成员 7.5 Using apply Methods in Objects as Constructors - apply方法 7.6 Implementing a Static Factory with apply - apply方法与静态工厂 7.7 Reifying Traits as Objects - 将特质具体化成对象 7.8 Implementing Pattern Matching with unapply - unapply方法与模式匹配
  8. Methods - 方法 8.1 Controlling Method Scope (Access Modifiers) - 方法的作用域 8.2 Calling a Method on a Superclass or Trait - 调用父类或特质的方法 8.3 Using Parameter Names When Calling a Method - 命名参数 8.4 Setting Default Values for Method Parameters - 参数的默认值 8.5 Creating Methods That Take Variable-Argument Fields - 可变参数 8.6 Forcing Callers to Leave Parentheses Off Accessor Methods - 无括号的方法调用 8.7 Declaring That a Method Can Throw an Exception - 声明异常 8.8 Supporting a Fluent Style of Programming - 链式调用风格 8.9 Adding New Methods to Closed Classes with Extension Methods - 扩展方法
  9. Packaging and Imports - 包和导入 9.1 Packaging with the Curly Braces Style Notation - 花括号风格的包语法 9.2 Importing One or More Members - 导入一个或多个成员 9.3 Renaming Members on Import - 导入并重命名成员 9.4 Hiding a Class During the Import Process - 导入时隐藏类 9.5 Importing Static Members - 导入静态成员 9.6 Using Import Statements Anywhere - 无处不在的导入语句 9.7 Importing Givens - 导入given
  10. Functional Programming - 函数式编程 10.1 Using Function Literals (Anonymous Functions) - 函数字面量(匿名函数) 10.2 Passing Functions Around as Variables - 将函数作为变量传递 10.3 Defining a Method That Accepts a Simple Function Parameter - 将函数作为方法的参数 10.4 Declaring More Complex Higher-Order Functions - 高阶函数 10.5 Using Partially Applied Functions - 部分应用函数 10.6 Creating a Method That Returns a Function - 返回函数的方法 10.7 Creating Partial Functions - 偏函数 10.8 Implementing Functional Error Handling - 函数式的错误处理 10.9 Real-World Example: Passing Functions Around in an Algorithm - 实际案例:在算法中传递函数 10.10 Real-World Example: Functional Domain Modeling - 实际案例:函数式领域建模
  11. Collections: Introduction - 集合:介绍 11.1 Choosing a Collections Class - 选择合适的集合类 11.2 Understanding the Performance of Collections - 集合的性能对比 11.3 Understanding Mutable Variables with Immutable Collections - 不可变集合与可变变量 11.4 Creating a Lazy View on a Collection - 惰性视图
  12. Collections: Common Sequence Classes - 集合:序列类 12.1 Making Vector Your Go-To Immutable Sequence - Vector 12.2 Creating and Populating a List - List 12.3 Adding Elements to a List - List的添加操作 12.4 Deleting Elements from a List (or ListBuffer) - List(或ListBuffer)的删除操作 12.5 Creating a Mutable List with ListBuffer - ListBuffer 12.6 Using LazyList, a Lazy Version of a List - LazyList 12.7 Making ArrayBuffer Your Go-To Mutable Sequence - ArrayBuffer 12.8 Deleting Array and ArrayBuffer Elements - Array和ArrayBuffer的删除操作 12.9 Creating and Updating an Array - 数组 12.10 Creating Multidimensional Arrays - 多维数组 12.11 Sorting Arrays - 数组排序
  13. Collections: Common Sequence Methods - 集合:常见的序列方法 13.1 Choosing a Collection Method to Solve a Problem - 选择合适的集合方法 13.2 Looping Over a Collection with foreach - foreach方法 13.3 Using Iterators - 迭代器 13.4 Using zipWithIndex or zip to Create Loop Counters - zipWithIndex和zip方法 13.5 Transforming One Collection to Another with map - map方法 13.6 Flattening a List of Lists with flatten - flatten方法 13.7 Using filter to Filter a Collection - filter方法 13.8 Extracting a Sequence of Elements from a Collection - 提取子序列 13.9 Splitting Sequences into Subsets - 序列的拆分 13.10 Walking Through a Collection with the reduce and fold Methods - reduce和fold方法 13.11 Finding the Unique Elements in a Sequence - 序列的去重 13.12 Merging Sequential Collections - 序列的合并 13.13 Randomizing a Sequence - shuffle序列 13.14 Sorting a Collection - 集合排序 13.15 Converting a Collection to a String with mkString and addString - mkString和addString方法
  14. Collections: Using Maps - 集合:Map 14.1 Creating and Using Maps - Map 14.2 Choosing a Map Implementation - 选择合适的Map 14.3 Adding, Updating, and Removing Immutable Map Elements - 不可变Map的添加、更新或删除操作 14.4 Adding, Updating, and Removing Elements in Mutable Maps - 可变Map的添加、更新或删除操作 14.5 Accessing Map Values (Without Exceptions) - 安全访问Map的值 14.6 Testing for the Existence of a Key or Value in a Map - 判断Map中键或值是否存在 14.7 Getting the Keys or Values from a Map - 获取Map中所有的键或值 14.8 Finding the Largest (or Smallest) Key or Value in a Map - 寻找Map中最大(或最小)的键或值 14.9 Traversing a Map - Map的遍历 14.10 Sorting an Existing Map by Key or Value - 根据键或值对Map排序 14.11 Filtering a Map - Map的过滤
  15. Collections: Tuple, Range, Set, Stack, and Queue - 集合:Tuple、Range、Set、Stack和Queue 15.1 Creating Heterogeneous Lists with Tuples - 元组与异构列表 15.2 Creating Ranges - Range 15.3 Creating a Set and Adding Elements to It - Set 15.4 Deleting Elements from Sets - Set的删除操作 15.5 Storing Values in a Set in Sorted Order - 有序Set 15.6 Creating and Using a Stack - 栈 15.7 Creating and Using a Queue - 队列
  16. Files and Processes - 文件和进程 16.1 Reading Text Files - 文本文件的读取 16.2 Writing Text Files - 文本文件的写入 16.3 Reading and Writing Binary Files - 二进制文件的读写 16.4 Pretending That a String Is a File - 将字符串当成文件 16.5 Serializing and Deserializing Objects to Files - 对象和文件间的序列化/反序列化 16.6 Listing Files in a Directory - 目录的遍历 16.7 Executing External Commands - 执行外部命令 16.8 Executing External Commands and Reading Their STDOUT - 执行外部命令并读取标准输出 16.9 Handling Both STDOUT and STDERR of Commands - 命令的标准输出和标准错误输出 16.10 Building a Pipeline of External Commands - 构建外部命令的管道
  17. Building Projects with sbt - sbt 17.1 Creating a Project Directory Structure for sbt - 新建sbt项目 17.2 Building Projects with the sbt Command - 构建sbt项目 17.3 Understanding build.sbt Syntax Styles - build.sbt文件 17.4 Compiling, Running, and Packaging a Scala Project - 编译、运行和打包 17.5 Understanding Other sbt Commands - 其他sbt命令 17.6 Continuous Compiling and Testing - 持续的编译和测试 17.7 Managing Dependencies with sbt - 依赖管理 17.8 Controlling Which Version of a Managed Dependency Is Used - 托管依赖的版本控制 17.9 Generating Project API Documentation - API文档的生成 17.10 Specifying a Main Class to Run with sbt - 指定sbt运行的mainClass 17.11 Deploying a Single Executable JAR File - sbt-assembly 17.12 Publishing Your Library - 发布类库
  18. Concurrency with Scala Futures and Akka Actors - Scala Futures和Akka Actors的并发 18.1 Creating a Future - Future 18.2 Using Callback and Transformation Methods with Futures - Future的回调和转换方法 18.3 Writing Methods That Return Futures - 返回Future的方法 18.4 Running Multiple Futures in Parallel - 多个Future的并行执行 18.5 Creating OOP-Style Actors - 面向对象风格的Actor 18.6 Creating FP-Style Actors - 函数式风格的Actor 18.7 Sending Messages to Actors - 向Actor发消息 18.8 Creating Actors That Have Multiple States (FSM) - 多种状态的Actor(FSM)
  19. Play Framework and Web Services - Play框架和Web服务 19.1 Creating a Play Framework Project - 新建Play项目 19.2 Creating a New Play Framework Endpoint - 新建Play的Web API 19.3 Returning JSON from a GET Request with Play - 返回JSON的GET请求 19.4 Serializing a Scala Object to a JSON String - 将Scala对象序列化成JSON 19.5 Deserializing JSON into a Scala Object - 将JSON反序列化成Scala对象 19.6 Using the Play JSON Library Outside of the Play Framework - 在非Play项目中使用Play JSON库 19.7 Using the sttp HTTP Client - 初识sttp
  20. Apache Spark - Apache Spark 20.1 Getting Started with Spark - 初识Spark 20.2 Reading a File into a Spark RDD - 将文件读入RDD 20.3 Reading a CSV File into a Spark RDD - 将CSV读入RDD 20.4 Using Spark Like a Database with DataFrames - DataFrame 20.5 Reading Data Files into a Spark DataFrame - 将文件读入DataFrame 20.6 Using Spark SQL Queries Against Multiple Files - 针对多个文件的Spark SQL查询 20.7 Creating a Spark Batch Application - Spark批处理程序
  21. Scala.js, GraalVM, and jpackage - Scala.js、GraalVM和jpackage 21.1 Getting Started with Scala.js - 初识Scala.js 21.2 Responding to Events with Scala.js - 响应事件 21.3 Building Single-Page Applications with Scala.js - 构建单页面应用 21.4 Building Native Executables with GraalVM - 使用GraalVM构建原生的可执行文件 21.5 Bundling Your Application with jpackage - jpackage
  22. Integrating Scala with Java - Scala与Java集成 22.1 Using Java Collections in Scala - 在Scala中使用Java的集合 22.2 Using Scala Collections in Java - 在Java中使用Scala的集合 22.3 Using Java Optional Values in Scala - 在Scala中使用Java的Optional 22.4 Using Scala Option Values in Java - 在Java中使用Scala的Option 22.5 Using Scala Traits in Java - 在Java中使用Scala的特质 22.6 Using Java Interfaces in Scala - 在Scala中使用Java的接口 22.7 Adding Exception Annotations to Scala Methods - @throws注解 22.8 Annotating varargs Methods to Work with Java - @varargs注解 22.9 Using @SerialVersionUID and Other Annotations - @SerialVersionUID和其他注解
  23. Types - 类型 @neomaclin 重点看 23.1 Creating a Method That Takes a Simple Generic Type - 泛型方法 23.2 Creating Classes That Use Simple Generic Types - 泛型类 23.3 Making Immutable Generic Parameters Covariant - 不可变泛型参数的协变 23.4 Creating a Class Whose Generic Elements Can Be Mutated - 元素类型可变化的类 23.5 Creating a Class Whose Parameters Implement a Base Type - 类的泛型类型边界 23.6 Using Duck Typing (Structural Types) - Duck类型(结构化类型) 23.7 Creating Meaningful Type Names with Opaque Types - 不透明类型与类型名称 23.8 Using Term Inference with given and using - given和using的术语推断 23.9 Simulating Dynamic Typing with Union Types - 联合类型与动态类型 23.10 Declaring That a Value Is a Combination of Types - 类型的组合 23.11 Controlling How Classes Can Be Compared with Multiversal Equality - 通过多元等价比较类 23.12 Limiting Equality Comparisons with the CanEqual Typeclass - CanEqual类型类
  24. Best Practices - 最佳实践 24.1 Writing Pure Functions - 纯函数 24.2 Using Immutable Variables and Collections - 不可变量与集合 24.3 Writing Expressions (Instead of Statements) - 表达式 24.4 Using Match Expressions and Pattern Matching - match表达式与模式匹配 24.5 Eliminating null Values from Your Code - 消除null值 24.6 Using Scala’s Error-Handling Types (Option, Try, and Either) - Option、Try和Either 24.7 Building Modular Systems - 构建模块化系统 24.8 Handling Option Values with Higher-Order Functions - 高阶函数与Option
jxnu-liguobin commented 2 years ago

多元等价 => 跨界相等性