diff --git a/_overviews/scala3-book/ca-context-bounds.md b/_overviews/scala3-book/ca-context-bounds.md index b42f71e56d..f1933fd6be 100644 --- a/_overviews/scala3-book/ca-context-bounds.md +++ b/_overviews/scala3-book/ca-context-bounds.md @@ -2,6 +2,7 @@ title: Context Bounds type: section description: This page demonstrates Context Bounds in Scala 3. +languages: [zh-cn] num: 61 previous-page: types-type-classes next-page: ca-given-imports diff --git a/_overviews/scala3-book/ca-contextual-abstractions-intro.md b/_overviews/scala3-book/ca-contextual-abstractions-intro.md index dc14d90c62..9f2d0955d7 100644 --- a/_overviews/scala3-book/ca-contextual-abstractions-intro.md +++ b/_overviews/scala3-book/ca-contextual-abstractions-intro.md @@ -2,6 +2,7 @@ title: Contextual Abstractions type: chapter description: This chapter provides an introduction to the Scala 3 concept of Contextual Abstractions. +languages: [zh-cn] num: 58 previous-page: types-others next-page: ca-given-using-clauses diff --git a/_overviews/scala3-book/ca-extension-methods.md b/_overviews/scala3-book/ca-extension-methods.md index b066aea99e..efa2348dc0 100644 --- a/_overviews/scala3-book/ca-extension-methods.md +++ b/_overviews/scala3-book/ca-extension-methods.md @@ -2,6 +2,7 @@ title: Extension Methods type: section description: This page demonstrates how Extension Methods work in Scala 3. +languages: [zh-cn] num: 63 previous-page: ca-given-imports next-page: ca-type-classes diff --git a/_overviews/scala3-book/ca-given-imports.md b/_overviews/scala3-book/ca-given-imports.md index 6cfb436a29..33b775b2eb 100644 --- a/_overviews/scala3-book/ca-given-imports.md +++ b/_overviews/scala3-book/ca-given-imports.md @@ -2,6 +2,7 @@ title: Given Imports type: section description: This page demonstrates how 'given' import statements work in Scala 3. +languages: [zh-cn] num: 62 previous-page: ca-context-bounds next-page: ca-extension-methods diff --git a/_overviews/scala3-book/ca-given-using-clauses.md b/_overviews/scala3-book/ca-given-using-clauses.md index c47d14fc25..6abf858e6e 100644 --- a/_overviews/scala3-book/ca-given-using-clauses.md +++ b/_overviews/scala3-book/ca-given-using-clauses.md @@ -2,6 +2,7 @@ title: Given Instances and Using Clauses type: section description: This page demonstrates how to use 'given' instances and 'using' clauses in Scala 3. +languages: [zh-cn] num: 59 previous-page: ca-contextual-abstractions-intro next-page: types-type-classes diff --git a/_overviews/scala3-book/ca-implicit-conversions.md b/_overviews/scala3-book/ca-implicit-conversions.md index d04cefa104..baadbaa9df 100644 --- a/_overviews/scala3-book/ca-implicit-conversions.md +++ b/_overviews/scala3-book/ca-implicit-conversions.md @@ -2,6 +2,7 @@ title: Implicit Conversions type: section description: This page demonstrates how to implement Implicit Conversions in Scala 3. +languages: [zh-cn] num: 66 previous-page: ca-multiversal-equality next-page: ca-summary diff --git a/_overviews/scala3-book/ca-multiversal-equality.md b/_overviews/scala3-book/ca-multiversal-equality.md index 215f2e2a7c..6ac592d4db 100644 --- a/_overviews/scala3-book/ca-multiversal-equality.md +++ b/_overviews/scala3-book/ca-multiversal-equality.md @@ -2,6 +2,7 @@ title: Multiversal Equality type: section description: This page demonstrates how to implement Multiversal Equality in Scala 3. +languages: [zh-cn] num: 65 previous-page: ca-type-classes next-page: ca-implicit-conversions diff --git a/_overviews/scala3-book/ca-summary.md b/_overviews/scala3-book/ca-summary.md index ef0bc9fea4..60c1e5e686 100644 --- a/_overviews/scala3-book/ca-summary.md +++ b/_overviews/scala3-book/ca-summary.md @@ -2,6 +2,7 @@ title: Summary type: section description: This page provides a summary of the Contextual Abstractions lessons. +languages: [zh-cn] num: 67 previous-page: ca-implicit-conversions next-page: concurrency diff --git a/_overviews/scala3-book/ca-type-classes.md b/_overviews/scala3-book/ca-type-classes.md index ee4cc4d1d7..1aad088767 100644 --- a/_overviews/scala3-book/ca-type-classes.md +++ b/_overviews/scala3-book/ca-type-classes.md @@ -2,6 +2,7 @@ title: Implementing Type Classes type: section description: This page demonstrates how to create and use type classes in Scala 3. +languages: [zh-cn] num: 64 previous-page: ca-extension-methods next-page: ca-multiversal-equality diff --git a/_overviews/scala3-book/collections-classes.md b/_overviews/scala3-book/collections-classes.md index f3dc1d03b4..70edce73f5 100644 --- a/_overviews/scala3-book/collections-classes.md +++ b/_overviews/scala3-book/collections-classes.md @@ -2,6 +2,7 @@ title: Collections Types type: section description: This page introduces the common Scala 3 collections types and some of their methods. +languages: [zh-cn] num: 37 previous-page: collections-intro next-page: collections-methods diff --git a/_overviews/scala3-book/collections-intro.md b/_overviews/scala3-book/collections-intro.md index 7ecf0a835e..8a0ae572ba 100644 --- a/_overviews/scala3-book/collections-intro.md +++ b/_overviews/scala3-book/collections-intro.md @@ -2,6 +2,7 @@ title: Scala Collections type: chapter description: This page provides and introduction to the common collections classes and their methods in Scala 3. +languages: [zh-cn] num: 36 previous-page: packaging-imports next-page: collections-classes diff --git a/_overviews/scala3-book/collections-methods.md b/_overviews/scala3-book/collections-methods.md index 6d09f2f1bf..a8892744ae 100644 --- a/_overviews/scala3-book/collections-methods.md +++ b/_overviews/scala3-book/collections-methods.md @@ -2,6 +2,7 @@ title: Collections Methods type: section description: This page demonstrates the common methods on the Scala 3 collections classes. +languages: [zh-cn] num: 38 previous-page: collections-classes next-page: collections-summary diff --git a/_overviews/scala3-book/collections-summary.md b/_overviews/scala3-book/collections-summary.md index 32aa74cd0c..446c8b90c9 100644 --- a/_overviews/scala3-book/collections-summary.md +++ b/_overviews/scala3-book/collections-summary.md @@ -2,6 +2,7 @@ title: Summary type: section description: This page provides a summary of the Collections chapter. +languages: [zh-cn] num: 39 previous-page: collections-methods next-page: fp-intro diff --git a/_overviews/scala3-book/concurrency.md b/_overviews/scala3-book/concurrency.md index 3cbe50c4e0..173e0ff72a 100644 --- a/_overviews/scala3-book/concurrency.md +++ b/_overviews/scala3-book/concurrency.md @@ -2,6 +2,7 @@ title: Concurrency type: chapter description: This page discusses how Scala concurrency works, with an emphasis on Scala Futures. +languages: [zh-cn] num: 68 previous-page: ca-summary next-page: scala-tools diff --git a/_overviews/scala3-book/control-structures.md b/_overviews/scala3-book/control-structures.md index 834f532638..61a315ffab 100644 --- a/_overviews/scala3-book/control-structures.md +++ b/_overviews/scala3-book/control-structures.md @@ -2,6 +2,7 @@ title: Control Structures type: chapter description: This page provides an introduction to Scala's control structures, including if/then/else, 'for' loops, 'for' expressions, 'match' expressions, try/catch/finally, and 'while' loops. +languages: [zh-cn] num: 18 previous-page: first-look-at-types next-page: domain-modeling-intro diff --git a/_overviews/scala3-book/domain-modeling-fp.md b/_overviews/scala3-book/domain-modeling-fp.md index 047883b605..f950eac7fe 100644 --- a/_overviews/scala3-book/domain-modeling-fp.md +++ b/_overviews/scala3-book/domain-modeling-fp.md @@ -2,6 +2,7 @@ title: FP Modeling type: section description: This chapter provides an introduction to FP domain modeling with Scala 3. +languages: [zh-cn] num: 22 previous-page: domain-modeling-oop next-page: methods-intro diff --git a/_overviews/scala3-book/domain-modeling-intro.md b/_overviews/scala3-book/domain-modeling-intro.md index 6707e9ddfe..1089997a9b 100644 --- a/_overviews/scala3-book/domain-modeling-intro.md +++ b/_overviews/scala3-book/domain-modeling-intro.md @@ -2,6 +2,7 @@ title: Domain Modeling type: chapter description: This chapter provides an introduction to domain modeling in Scala 3. +languages: [zh-cn] num: 19 previous-page: control-structures next-page: domain-modeling-tools diff --git a/_overviews/scala3-book/domain-modeling-oop.md b/_overviews/scala3-book/domain-modeling-oop.md index db91c504f2..6ee732654b 100644 --- a/_overviews/scala3-book/domain-modeling-oop.md +++ b/_overviews/scala3-book/domain-modeling-oop.md @@ -2,6 +2,7 @@ title: OOP Modeling type: section description: This chapter provides an introduction to OOP domain modeling with Scala 3. +languages: [zh-cn] num: 21 previous-page: domain-modeling-tools next-page: domain-modeling-fp diff --git a/_overviews/scala3-book/domain-modeling-tools.md b/_overviews/scala3-book/domain-modeling-tools.md index 855592dbc6..52ff30139e 100644 --- a/_overviews/scala3-book/domain-modeling-tools.md +++ b/_overviews/scala3-book/domain-modeling-tools.md @@ -2,6 +2,7 @@ title: Tools type: section description: This chapter provides an introduction to the available domain modeling tools in Scala 3, including classes, traits, enums, and more. +languages: [zh-cn] num: 20 previous-page: domain-modeling-intro next-page: domain-modeling-oop diff --git a/_overviews/scala3-book/first-look-at-types.md b/_overviews/scala3-book/first-look-at-types.md index 32e24f19b3..479ae136ab 100644 --- a/_overviews/scala3-book/first-look-at-types.md +++ b/_overviews/scala3-book/first-look-at-types.md @@ -2,6 +2,7 @@ title: A First Look at Types type: chapter description: This page provides a brief introduction to Scala's built-in data types, including Int, Double, String, Long, Any, AnyRef, Nothing, and Null. +languages: [zh-cn] num: 17 previous-page: taste-summary next-page: control-structures diff --git a/_overviews/scala3-book/fp-functional-error-handling.md b/_overviews/scala3-book/fp-functional-error-handling.md index 41410e5cf1..8fa2b92bd7 100644 --- a/_overviews/scala3-book/fp-functional-error-handling.md +++ b/_overviews/scala3-book/fp-functional-error-handling.md @@ -2,6 +2,7 @@ title: Functional Error Handling type: section description: This section provides an introduction to functional error handling in Scala 3. +languages: [zh-cn] num: 45 previous-page: fp-functions-are-values next-page: fp-summary diff --git a/_overviews/scala3-book/fp-functions-are-values.md b/_overviews/scala3-book/fp-functions-are-values.md index d2766c65fe..8560710c34 100644 --- a/_overviews/scala3-book/fp-functions-are-values.md +++ b/_overviews/scala3-book/fp-functions-are-values.md @@ -2,6 +2,7 @@ title: Functions Are Values type: section description: This section looks at the use of functions as values in functional programming. +languages: [zh-cn] num: 44 previous-page: fp-pure-functions next-page: fp-functional-error-handling diff --git a/_overviews/scala3-book/fp-immutable-values.md b/_overviews/scala3-book/fp-immutable-values.md index c5a4cc3eb3..c0e6209df5 100644 --- a/_overviews/scala3-book/fp-immutable-values.md +++ b/_overviews/scala3-book/fp-immutable-values.md @@ -2,6 +2,7 @@ title: Immutable Values type: section description: This section looks at the use of immutable values in functional programming. +languages: [zh-cn] num: 42 previous-page: fp-what-is-fp next-page: fp-pure-functions diff --git a/_overviews/scala3-book/fp-intro.md b/_overviews/scala3-book/fp-intro.md index 03aed71900..56c43362c8 100644 --- a/_overviews/scala3-book/fp-intro.md +++ b/_overviews/scala3-book/fp-intro.md @@ -2,6 +2,7 @@ title: Functional Programming type: chapter description: This chapter provides an introduction to functional programming in Scala 3. +languages: [zh-cn] num: 40 previous-page: collections-summary next-page: fp-what-is-fp diff --git a/_overviews/scala3-book/fp-pure-functions.md b/_overviews/scala3-book/fp-pure-functions.md index 82199b14e0..e979d6a446 100644 --- a/_overviews/scala3-book/fp-pure-functions.md +++ b/_overviews/scala3-book/fp-pure-functions.md @@ -2,6 +2,7 @@ title: Pure Functions type: section description: This section looks at the use of pure functions in functional programming. +languages: [zh-cn] num: 43 previous-page: fp-immutable-values next-page: fp-functions-are-values diff --git a/_overviews/scala3-book/fp-summary.md b/_overviews/scala3-book/fp-summary.md index 9857501e84..7a9caff971 100644 --- a/_overviews/scala3-book/fp-summary.md +++ b/_overviews/scala3-book/fp-summary.md @@ -2,6 +2,7 @@ title: Summary type: section description: This section summarizes the previous functional programming sections. +languages: [zh-cn] num: 46 previous-page: fp-functional-error-handling next-page: types-introduction diff --git a/_overviews/scala3-book/fp-what-is-fp.md b/_overviews/scala3-book/fp-what-is-fp.md index 0b380447c8..034f2ecc16 100644 --- a/_overviews/scala3-book/fp-what-is-fp.md +++ b/_overviews/scala3-book/fp-what-is-fp.md @@ -2,6 +2,7 @@ title: What is Functional Programming? type: section description: This section provides an answer to the question, what is functional programming? +languages: [zh-cn] num: 41 previous-page: fp-intro next-page: fp-immutable-values diff --git a/_overviews/scala3-book/fun-anonymous-functions.md b/_overviews/scala3-book/fun-anonymous-functions.md index 39d87da216..8dba264ce6 100644 --- a/_overviews/scala3-book/fun-anonymous-functions.md +++ b/_overviews/scala3-book/fun-anonymous-functions.md @@ -2,6 +2,7 @@ title: Anonymous Functions type: section description: This page shows how to use anonymous functions in Scala, including examples with the List class 'map' and 'filter' functions. +languages: [zh-cn] num: 28 previous-page: fun-intro next-page: fun-function-variables diff --git a/_overviews/scala3-book/fun-eta-expansion.md b/_overviews/scala3-book/fun-eta-expansion.md index d48e6c059b..e9590a65f0 100644 --- a/_overviews/scala3-book/fun-eta-expansion.md +++ b/_overviews/scala3-book/fun-eta-expansion.md @@ -2,6 +2,7 @@ title: Eta Expansion type: section description: This page discusses Eta Expansion, the Scala technology that automatically and transparently converts methods into functions. +languages: [zh-cn] num: 30 previous-page: fun-function-variables next-page: fun-hofs diff --git a/_overviews/scala3-book/fun-function-variables.md b/_overviews/scala3-book/fun-function-variables.md index 758a8568b7..48f4d5ea28 100644 --- a/_overviews/scala3-book/fun-function-variables.md +++ b/_overviews/scala3-book/fun-function-variables.md @@ -2,6 +2,7 @@ title: Function Variables type: section description: This page shows how to use anonymous functions in Scala, including examples with the List class 'map' and 'filter' functions. +languages: [zh-cn] num: 29 previous-page: fun-anonymous-functions next-page: fun-eta-expansion diff --git a/_overviews/scala3-book/fun-hofs.md b/_overviews/scala3-book/fun-hofs.md index 0985c38ea2..f976513ecf 100644 --- a/_overviews/scala3-book/fun-hofs.md +++ b/_overviews/scala3-book/fun-hofs.md @@ -2,6 +2,7 @@ title: Higher-Order Functions type: section description: This page demonstrates how to create and use higher-order functions in Scala. +languages: [zh-cn] num: 31 previous-page: fun-eta-expansion next-page: fun-write-map-function diff --git a/_overviews/scala3-book/fun-intro.md b/_overviews/scala3-book/fun-intro.md index ba22b69d7a..e2b9cd798f 100644 --- a/_overviews/scala3-book/fun-intro.md +++ b/_overviews/scala3-book/fun-intro.md @@ -2,6 +2,7 @@ title: Functions type: chapter description: This chapter looks at all topics related to functions in Scala 3. +languages: [zh-cn] num: 27 previous-page: methods-summary next-page: fun-anonymous-functions diff --git a/_overviews/scala3-book/fun-summary.md b/_overviews/scala3-book/fun-summary.md index e2e9488629..4b23367b47 100644 --- a/_overviews/scala3-book/fun-summary.md +++ b/_overviews/scala3-book/fun-summary.md @@ -2,6 +2,7 @@ title: Summary type: section description: This page shows how to use anonymous functions in Scala, including examples with the List class 'map' and 'filter' functions. +languages: [zh-cn] num: 34 previous-page: fun-write-method-returns-function next-page: packaging-imports diff --git a/_overviews/scala3-book/fun-write-map-function.md b/_overviews/scala3-book/fun-write-map-function.md index 74cab95213..e418780cf7 100644 --- a/_overviews/scala3-book/fun-write-map-function.md +++ b/_overviews/scala3-book/fun-write-map-function.md @@ -2,6 +2,7 @@ title: Write Your Own map Method type: section description: This page demonstrates how to create and use higher-order functions in Scala. +languages: [zh-cn] num: 32 previous-page: fun-hofs next-page: fun-write-method-returns-function diff --git a/_overviews/scala3-book/fun-write-method-returns-function.md b/_overviews/scala3-book/fun-write-method-returns-function.md index 825ad0cdfe..6ca9f31002 100644 --- a/_overviews/scala3-book/fun-write-method-returns-function.md +++ b/_overviews/scala3-book/fun-write-method-returns-function.md @@ -2,6 +2,7 @@ title: Creating a Method That Returns a Function type: section description: This page demonstrates how to create and use higher-order functions in Scala. +languages: [zh-cn] num: 33 previous-page: fun-write-map-function next-page: fun-summary diff --git a/_overviews/scala3-book/interacting-with-java.md b/_overviews/scala3-book/interacting-with-java.md index 300ebed689..06a5a8fa62 100644 --- a/_overviews/scala3-book/interacting-with-java.md +++ b/_overviews/scala3-book/interacting-with-java.md @@ -2,6 +2,7 @@ title: Interacting with Java type: chapter description: This page demonstrates how Scala code can interact with Java, and how Java code can interact with Scala code. +languages: [zh-cn] num: 72 previous-page: tools-worksheets next-page: scala-for-java-devs diff --git a/_overviews/scala3-book/introduction.md b/_overviews/scala3-book/introduction.md index 8533dca2b5..737e068e75 100644 --- a/_overviews/scala3-book/introduction.md +++ b/_overviews/scala3-book/introduction.md @@ -2,6 +2,7 @@ title: Introduction type: chapter description: This page begins the overview documentation of the Scala 3 language. +languages: [zh-cn] num: 1 previous-page: next-page: scala-features diff --git a/_overviews/scala3-book/methods-intro.md b/_overviews/scala3-book/methods-intro.md index 1c1414746c..9170ec39b2 100644 --- a/_overviews/scala3-book/methods-intro.md +++ b/_overviews/scala3-book/methods-intro.md @@ -2,6 +2,7 @@ title: Methods type: chapter description: This section introduces methods in Scala 3. +languages: [zh-cn] num: 23 previous-page: domain-modeling-fp next-page: methods-most diff --git a/_overviews/scala3-book/methods-main-methods.md b/_overviews/scala3-book/methods-main-methods.md index c24ce22723..f88cebc16d 100644 --- a/_overviews/scala3-book/methods-main-methods.md +++ b/_overviews/scala3-book/methods-main-methods.md @@ -2,6 +2,7 @@ title: main Methods type: section description: This page describes how 'main' methods and the '@main' annotation work in Scala 3. +languages: [zh-cn] num: 25 previous-page: methods-most next-page: methods-summary diff --git a/_overviews/scala3-book/methods-most.md b/_overviews/scala3-book/methods-most.md index 233c51b847..e8d540b8cf 100644 --- a/_overviews/scala3-book/methods-most.md +++ b/_overviews/scala3-book/methods-most.md @@ -2,6 +2,7 @@ title: Method Features type: section description: This section introduces Scala 3 methods, including main methods, extension methods, and more. +languages: [zh-cn] num: 24 previous-page: methods-intro next-page: methods-main-methods diff --git a/_overviews/scala3-book/methods-summary.md b/_overviews/scala3-book/methods-summary.md index 9894c6d4c9..1148e37160 100644 --- a/_overviews/scala3-book/methods-summary.md +++ b/_overviews/scala3-book/methods-summary.md @@ -2,6 +2,7 @@ title: Summary type: section description: This section summarizes the previous sections on Scala 3 methods. +languages: [zh-cn] num: 26 previous-page: methods-main-methods next-page: fun-intro diff --git a/_overviews/scala3-book/packaging-imports.md b/_overviews/scala3-book/packaging-imports.md index e6e1aa7c91..6cd3835078 100644 --- a/_overviews/scala3-book/packaging-imports.md +++ b/_overviews/scala3-book/packaging-imports.md @@ -2,6 +2,7 @@ title: Packaging and Imports type: chapter description: A discussion of using packages and imports to organize your code, build related modules of code, control scope, and help prevent namespace collisions. +languages: [zh-cn] num: 35 previous-page: fun-summary next-page: collections-intro diff --git a/_overviews/scala3-book/scala-features.md b/_overviews/scala3-book/scala-features.md index 8d43e7c6cc..50817f4980 100644 --- a/_overviews/scala3-book/scala-features.md +++ b/_overviews/scala3-book/scala-features.md @@ -2,6 +2,7 @@ title: Scala Features type: chapter description: This page discusses the main features of the Scala programming language. +languages: [zh-cn] num: 2 previous-page: introduction next-page: why-scala-3 diff --git a/_overviews/scala3-book/scala-for-java-devs.md b/_overviews/scala3-book/scala-for-java-devs.md index 86a1d11511..53646a7d06 100644 --- a/_overviews/scala3-book/scala-for-java-devs.md +++ b/_overviews/scala3-book/scala-for-java-devs.md @@ -2,6 +2,7 @@ title: Scala for Java Developers type: chapter description: This page is for Java developers who are interested in learning about Scala 3. +languages: [zh-cn] num: 73 previous-page: interacting-with-java next-page: scala-for-javascript-devs diff --git a/_overviews/scala3-book/scala-for-javascript-devs.md b/_overviews/scala3-book/scala-for-javascript-devs.md index 462a1017ce..ff9d4ffeb5 100644 --- a/_overviews/scala3-book/scala-for-javascript-devs.md +++ b/_overviews/scala3-book/scala-for-javascript-devs.md @@ -2,6 +2,7 @@ title: Scala for JavaScript Developers type: chapter description: This chapter provides an introduction to Scala 3 for JavaScript developers +languages: [zh-cn] num: 74 previous-page: scala-for-java-devs next-page: scala-for-python-devs diff --git a/_overviews/scala3-book/scala-for-python-devs.md b/_overviews/scala3-book/scala-for-python-devs.md index 0b11204ffa..70d5d43db5 100644 --- a/_overviews/scala3-book/scala-for-python-devs.md +++ b/_overviews/scala3-book/scala-for-python-devs.md @@ -2,6 +2,7 @@ title: Scala for Python Developers type: chapter description: This page is for Python developers who are interested in learning about Scala 3. +languages: [zh-cn] num: 75 previous-page: scala-for-javascript-devs next-page: where-next diff --git a/_overviews/scala3-book/scala-tools.md b/_overviews/scala3-book/scala-tools.md index 52e4bc67b7..1b6badd809 100644 --- a/_overviews/scala3-book/scala-tools.md +++ b/_overviews/scala3-book/scala-tools.md @@ -2,6 +2,7 @@ title: Scala Tools type: chapter description: This chapter looks at two commonly-used Scala tools, sbt and ScalaTest. +languages: [zh-cn] num: 69 previous-page: concurrency next-page: tools-sbt diff --git a/_overviews/scala3-book/taste-collections.md b/_overviews/scala3-book/taste-collections.md index fe1232914f..84fb394a64 100644 --- a/_overviews/scala3-book/taste-collections.md +++ b/_overviews/scala3-book/taste-collections.md @@ -2,6 +2,7 @@ title: Collections type: section description: This page provides a high-level overview of the main features of the Scala 3 programming language. +languages: [zh-cn] num: 13 previous-page: taste-objects next-page: taste-contextual-abstractions @@ -102,7 +103,8 @@ You can also use this _extractor_ approach to assign the tuple fields to variabl val (num, str, person) = t // result: -// val num: Int = 11 +// val languages: [zh-cn] +num: Int = 11 // val str: String = eleven // val person: Person = Person(Eleven) ``` diff --git a/_overviews/scala3-book/taste-contextual-abstractions.md b/_overviews/scala3-book/taste-contextual-abstractions.md index 097800b288..c1db055e9e 100644 --- a/_overviews/scala3-book/taste-contextual-abstractions.md +++ b/_overviews/scala3-book/taste-contextual-abstractions.md @@ -2,6 +2,7 @@ title: Contextual Abstractions type: section description: This section provides an introduction to Contextual Abstractions in Scala 3. +languages: [zh-cn] num: 14 previous-page: taste-collections next-page: taste-toplevel-definitions diff --git a/_overviews/scala3-book/taste-control-structures.md b/_overviews/scala3-book/taste-control-structures.md index 13e55a4233..241facb117 100644 --- a/_overviews/scala3-book/taste-control-structures.md +++ b/_overviews/scala3-book/taste-control-structures.md @@ -2,6 +2,7 @@ title: Control Structures type: section description: This section demonstrates Scala 3 control structures. +languages: [zh-cn] num: 8 previous-page: taste-vars-data-types next-page: taste-modeling diff --git a/_overviews/scala3-book/taste-functions.md b/_overviews/scala3-book/taste-functions.md index b103dba666..0f3779eaf3 100644 --- a/_overviews/scala3-book/taste-functions.md +++ b/_overviews/scala3-book/taste-functions.md @@ -2,6 +2,7 @@ title: First-Class Functions type: section description: This page provides an introduction to functions in Scala 3. +languages: [zh-cn] num: 11 previous-page: taste-methods next-page: taste-objects diff --git a/_overviews/scala3-book/taste-hello-world.md b/_overviews/scala3-book/taste-hello-world.md index b43512cdf7..a4275d4a91 100644 --- a/_overviews/scala3-book/taste-hello-world.md +++ b/_overviews/scala3-book/taste-hello-world.md @@ -2,6 +2,7 @@ title: Hello, World! type: section description: This section demonstrates a Scala 3 'Hello, World!' example. +languages: [zh-cn] num: 5 previous-page: taste-intro next-page: taste-repl diff --git a/_overviews/scala3-book/taste-intro.md b/_overviews/scala3-book/taste-intro.md index 9c189ab9a5..877d6506d8 100644 --- a/_overviews/scala3-book/taste-intro.md +++ b/_overviews/scala3-book/taste-intro.md @@ -2,6 +2,7 @@ title: A Taste of Scala type: chapter description: This chapter provides a high-level overview of the main features of the Scala 3 programming language. +languages: [zh-cn] num: 4 previous-page: why-scala-3 next-page: taste-hello-world diff --git a/_overviews/scala3-book/taste-methods.md b/_overviews/scala3-book/taste-methods.md index 2718059bb1..6f6012d856 100644 --- a/_overviews/scala3-book/taste-methods.md +++ b/_overviews/scala3-book/taste-methods.md @@ -2,6 +2,7 @@ title: Methods type: section description: This section provides an introduction to defining and using methods in Scala 3. +languages: [zh-cn] num: 10 previous-page: taste-modeling next-page: taste-functions diff --git a/_overviews/scala3-book/taste-modeling.md b/_overviews/scala3-book/taste-modeling.md index 20c605c6f9..666fc0865d 100644 --- a/_overviews/scala3-book/taste-modeling.md +++ b/_overviews/scala3-book/taste-modeling.md @@ -2,6 +2,7 @@ title: Domain Modeling type: section description: This section provides an introduction to data modeling in Scala 3. +languages: [zh-cn] num: 9 previous-page: taste-control-structures next-page: taste-methods diff --git a/_overviews/scala3-book/taste-objects.md b/_overviews/scala3-book/taste-objects.md index 4fbb325eb2..6d19b9d2d5 100644 --- a/_overviews/scala3-book/taste-objects.md +++ b/_overviews/scala3-book/taste-objects.md @@ -2,6 +2,7 @@ title: Singleton Objects type: section description: This section provides an introduction to the use of singleton objects in Scala 3. +languages: [zh-cn] num: 12 previous-page: taste-functions next-page: taste-collections diff --git a/_overviews/scala3-book/taste-repl.md b/_overviews/scala3-book/taste-repl.md index 20eecec556..868b38222c 100644 --- a/_overviews/scala3-book/taste-repl.md +++ b/_overviews/scala3-book/taste-repl.md @@ -2,6 +2,7 @@ title: The REPL type: section description: This section provides an introduction to the Scala REPL. +languages: [zh-cn] num: 6 previous-page: taste-hello-world next-page: taste-vars-data-types diff --git a/_overviews/scala3-book/taste-summary.md b/_overviews/scala3-book/taste-summary.md index 46a5b55623..d04d2db8a4 100644 --- a/_overviews/scala3-book/taste-summary.md +++ b/_overviews/scala3-book/taste-summary.md @@ -2,6 +2,7 @@ title: Summary type: section description: This page provides a summary of the previous 'Taste of Scala' sections. +languages: [zh-cn] num: 16 previous-page: taste-toplevel-definitions next-page: first-look-at-types diff --git a/_overviews/scala3-book/taste-toplevel-definitions.md b/_overviews/scala3-book/taste-toplevel-definitions.md index 3d3a1385ed..604ee0a0dd 100644 --- a/_overviews/scala3-book/taste-toplevel-definitions.md +++ b/_overviews/scala3-book/taste-toplevel-definitions.md @@ -2,6 +2,7 @@ title: Toplevel Definitions type: section description: This page provides an introduction to top-level definitions in Scala 3 +languages: [zh-cn] num: 15 previous-page: taste-contextual-abstractions next-page: taste-summary diff --git a/_overviews/scala3-book/taste-vars-data-types.md b/_overviews/scala3-book/taste-vars-data-types.md index 36b7445a52..efa578f07c 100644 --- a/_overviews/scala3-book/taste-vars-data-types.md +++ b/_overviews/scala3-book/taste-vars-data-types.md @@ -2,6 +2,7 @@ title: Variables and Data Types type: section description: This section demonstrates val and var variables, and some common Scala data types. +languages: [zh-cn] num: 7 previous-page: taste-repl next-page: taste-control-structures diff --git a/_overviews/scala3-book/tools-sbt.md b/_overviews/scala3-book/tools-sbt.md index eb1ed8f0e6..8735cbce68 100644 --- a/_overviews/scala3-book/tools-sbt.md +++ b/_overviews/scala3-book/tools-sbt.md @@ -2,6 +2,7 @@ title: Building and Testing Scala Projects with sbt type: section description: This section looks at a commonly-used build tool, sbt, and a testing library, ScalaTest. +languages: [zh-cn] num: 70 previous-page: scala-tools next-page: tools-worksheets diff --git a/_overviews/scala3-book/tools-worksheets.md b/_overviews/scala3-book/tools-worksheets.md index 3231d4e654..5c8dacf3e5 100644 --- a/_overviews/scala3-book/tools-worksheets.md +++ b/_overviews/scala3-book/tools-worksheets.md @@ -2,6 +2,7 @@ title: Worksheets type: section description: This section looks at worksheets, an alternative to Scala projects. +languages: [zh-cn] num: 71 previous-page: tools-sbt next-page: interacting-with-java diff --git a/_overviews/scala3-book/types-adts-gadts.md b/_overviews/scala3-book/types-adts-gadts.md index 19d9641b4a..1ee8fb48a6 100644 --- a/_overviews/scala3-book/types-adts-gadts.md +++ b/_overviews/scala3-book/types-adts-gadts.md @@ -2,6 +2,7 @@ title: Algebraic Data Types type: section description: This section introduces and demonstrates algebraic data types (ADTs) in Scala 3. +languages: [zh-cn] num: 52 previous-page: types-union next-page: types-variance diff --git a/_overviews/scala3-book/types-dependent-function.md b/_overviews/scala3-book/types-dependent-function.md index e70ed26045..1350477fcd 100644 --- a/_overviews/scala3-book/types-dependent-function.md +++ b/_overviews/scala3-book/types-dependent-function.md @@ -2,6 +2,7 @@ title: Dependent Function Types type: section description: This section introduces and demonstrates dependent function types in Scala 3. +languages: [zh-cn] num: 56 previous-page: types-structural next-page: types-others diff --git a/_overviews/scala3-book/types-generics.md b/_overviews/scala3-book/types-generics.md index 004e82e8e5..afedd70a7f 100644 --- a/_overviews/scala3-book/types-generics.md +++ b/_overviews/scala3-book/types-generics.md @@ -2,6 +2,7 @@ title: Generics type: section description: This section introduces and demonstrates generics in Scala 3. +languages: [zh-cn] num: 49 previous-page: types-inferred next-page: types-intersection diff --git a/_overviews/scala3-book/types-inferred.md b/_overviews/scala3-book/types-inferred.md index d56bafb629..a33be89bad 100644 --- a/_overviews/scala3-book/types-inferred.md +++ b/_overviews/scala3-book/types-inferred.md @@ -2,6 +2,7 @@ title: Inferred Types type: section description: This section introduces and demonstrates inferred types in Scala 3 +languages: [zh-cn] num: 48 previous-page: types-introduction next-page: types-generics diff --git a/_overviews/scala3-book/types-intersection.md b/_overviews/scala3-book/types-intersection.md index 625f2bfa20..deb7e58b0a 100644 --- a/_overviews/scala3-book/types-intersection.md +++ b/_overviews/scala3-book/types-intersection.md @@ -2,6 +2,7 @@ title: Intersection Types type: section description: This section introduces and demonstrates intersection types in Scala 3. +languages: [zh-cn] num: 50 previous-page: types-generics next-page: types-union diff --git a/_overviews/scala3-book/types-introduction.md b/_overviews/scala3-book/types-introduction.md index 5719112cae..cf387c9ac7 100644 --- a/_overviews/scala3-book/types-introduction.md +++ b/_overviews/scala3-book/types-introduction.md @@ -2,6 +2,7 @@ title: Types and the Type System type: chapter description: This chapter provides an introduction to Scala 3 types and the type system. +languages: [zh-cn] num: 47 previous-page: fp-summary next-page: types-inferred diff --git a/_overviews/scala3-book/types-opaque-types.md b/_overviews/scala3-book/types-opaque-types.md index adaa7248ad..cf25539c3f 100644 --- a/_overviews/scala3-book/types-opaque-types.md +++ b/_overviews/scala3-book/types-opaque-types.md @@ -2,6 +2,7 @@ title: Opaque Types type: section description: This section introduces and demonstrates opaque types in Scala 3. +languages: [zh-cn] num: 54 previous-page: types-variance next-page: types-structural diff --git a/_overviews/scala3-book/types-others.md b/_overviews/scala3-book/types-others.md index cb87cccf2e..30447a4315 100644 --- a/_overviews/scala3-book/types-others.md +++ b/_overviews/scala3-book/types-others.md @@ -2,6 +2,7 @@ title: Other Types type: section description: This section mentions other advanced types in Scala 3. +languages: [zh-cn] num: 57 previous-page: types-dependent-function next-page: ca-contextual-abstractions-intro diff --git a/_overviews/scala3-book/types-structural.md b/_overviews/scala3-book/types-structural.md index 8ae1d57d93..8acdbc1725 100644 --- a/_overviews/scala3-book/types-structural.md +++ b/_overviews/scala3-book/types-structural.md @@ -2,6 +2,7 @@ title: Structural Types type: section description: This section introduces and demonstrates structural types in Scala 3. +languages: [zh-cn] num: 55 previous-page: types-opaque-types next-page: types-dependent-function diff --git a/_overviews/scala3-book/types-type-classes.md b/_overviews/scala3-book/types-type-classes.md index f0391f3806..19c20fba89 100644 --- a/_overviews/scala3-book/types-type-classes.md +++ b/_overviews/scala3-book/types-type-classes.md @@ -2,6 +2,7 @@ title: Type Classes type: section description: This section introduces type classes in Scala 3. +languages: [zh-cn] num: 60 previous-page: ca-given-using-clauses next-page: ca-context-bounds diff --git a/_overviews/scala3-book/types-union.md b/_overviews/scala3-book/types-union.md index 049b0c11eb..1636556767 100644 --- a/_overviews/scala3-book/types-union.md +++ b/_overviews/scala3-book/types-union.md @@ -2,6 +2,7 @@ title: Union Types type: section description: This section introduces and demonstrates union types in Scala 3. +languages: [zh-cn] num: 51 previous-page: types-intersection next-page: types-adts-gadts diff --git a/_overviews/scala3-book/types-variance.md b/_overviews/scala3-book/types-variance.md index 84cba7d658..568ce0e494 100644 --- a/_overviews/scala3-book/types-variance.md +++ b/_overviews/scala3-book/types-variance.md @@ -2,6 +2,7 @@ title: Variance type: section description: This section introduces and demonstrates variance in Scala 3. +languages: [zh-cn] num: 53 previous-page: types-adts-gadts next-page: types-opaque-types diff --git a/_overviews/scala3-book/where-next.md b/_overviews/scala3-book/where-next.md index 9b9a148e5a..43e9ec8424 100644 --- a/_overviews/scala3-book/where-next.md +++ b/_overviews/scala3-book/where-next.md @@ -2,6 +2,7 @@ title: Where To Go Next type: chapter description: Where to go next after reading the Scala Book +languages: [zh-cn] num: 76 previous-page: scala-for-python-devs next-page: diff --git a/_overviews/scala3-book/why-scala-3.md b/_overviews/scala3-book/why-scala-3.md index 3b7ea60c31..5b936e2790 100644 --- a/_overviews/scala3-book/why-scala-3.md +++ b/_overviews/scala3-book/why-scala-3.md @@ -2,6 +2,7 @@ title: Why Scala 3? type: chapter description: This page describes the benefits of the Scala 3 programming language. +languages: [zh-cn] num: 3 previous-page: scala-features next-page: taste-intro diff --git a/_zh-cn/overviews/scala3-book/ca-context-bounds.md b/_zh-cn/overviews/scala3-book/ca-context-bounds.md index 35cad7d6db..72b55ca94d 100644 --- a/_zh-cn/overviews/scala3-book/ca-context-bounds.md +++ b/_zh-cn/overviews/scala3-book/ca-context-bounds.md @@ -5,6 +5,11 @@ description: This page demonstrates Context Bounds in Scala 3. num: 61 previous-page: types-type-classes next-page: ca-given-imports + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/ca-contextual-abstractions-intro.md b/_zh-cn/overviews/scala3-book/ca-contextual-abstractions-intro.md index e58fedc4aa..0cb7bd80c1 100644 --- a/_zh-cn/overviews/scala3-book/ca-contextual-abstractions-intro.md +++ b/_zh-cn/overviews/scala3-book/ca-contextual-abstractions-intro.md @@ -5,6 +5,11 @@ description: This chapter provides an introduction to the Scala 3 concept of Con num: 58 previous-page: types-others next-page: ca-given-using-clauses + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -72,11 +77,11 @@ Scala 3 中的这些更改实现了术语推理与语言其余部分的更好分 本章将在以下各节中介绍其中的许多新功能。 -[givens]: {% link _overviews/scala3-book/ca-given-using-clauses.md %} -[given-imports]: {% link _overviews/scala3-book/ca-given-imports.md %} -[implicit-conversions]: {% link _overviews/scala3-book/ca-implicit-conversions.md %} -[extension-methods]: {% link _overviews/scala3-book/ca-extension-methods.md %} -[context-bounds]: {% link _overviews/scala3-book/ca-context-bounds.md %} -[type-classes]: {% link _overviews/scala3-book/ca-type-classes.md %} -[equality]: {% link _overviews/scala3-book/ca-multiversal-equality.md %} -[contextual-functions]: {% link _overviews/scala3-book/types-dependent-function.md %} +[givens]: {% link _zh-cn/overviews/scala3-book/ca-given-using-clauses.md %} +[given-imports]: {% link _zh-cn/overviews/scala3-book/ca-given-imports.md %} +[implicit-conversions]: {% link _zh-cn/overviews/scala3-book/ca-implicit-conversions.md %} +[extension-methods]: {% link _zh-cn/overviews/scala3-book/ca-extension-methods.md %} +[context-bounds]: {% link _zh-cn/overviews/scala3-book/ca-context-bounds.md %} +[type-classes]: {% link _zh-cn/overviews/scala3-book/ca-type-classes.md %} +[equality]: {% link _zh-cn/overviews/scala3-book/ca-multiversal-equality.md %} +[contextual-functions]: {% link _zh-cn/overviews/scala3-book/types-dependent-function.md %} diff --git a/_zh-cn/overviews/scala3-book/ca-extension-methods.md b/_zh-cn/overviews/scala3-book/ca-extension-methods.md index b3e8e8b091..8565811725 100644 --- a/_zh-cn/overviews/scala3-book/ca-extension-methods.md +++ b/_zh-cn/overviews/scala3-book/ca-extension-methods.md @@ -5,6 +5,11 @@ description: This page demonstrates how Extension Methods work in Scala 3. num: 63 previous-page: ca-given-imports next-page: ca-type-classes + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/ca-given-imports.md b/_zh-cn/overviews/scala3-book/ca-given-imports.md index d1b69f57e0..245cd1feec 100644 --- a/_zh-cn/overviews/scala3-book/ca-given-imports.md +++ b/_zh-cn/overviews/scala3-book/ca-given-imports.md @@ -5,6 +5,11 @@ description: This page demonstrates how 'given' import statements work in Scala num: 62 previous-page: ca-context-bounds next-page: ca-extension-methods + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -45,4 +50,4 @@ object B: “导入 given”语法的更多示例见 [package 和 import 章节][imports]。 -[imports]: {% link _overviews/scala3-book/packaging-imports.md %} +[imports]: {% link _zh-cn/overviews/scala3-book/packaging-imports.md %} diff --git a/_zh-cn/overviews/scala3-book/ca-given-using-clauses.md b/_zh-cn/overviews/scala3-book/ca-given-using-clauses.md index 704f83bd82..4d6eed12fe 100644 --- a/_zh-cn/overviews/scala3-book/ca-given-using-clauses.md +++ b/_zh-cn/overviews/scala3-book/ca-given-using-clauses.md @@ -5,6 +5,11 @@ description: This page demonstrates how to use 'given' instances and 'using' cla num: 59 previous-page: ca-contextual-abstractions-intro next-page: types-type-classes + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- Scala 3 offers two important feature for contextual abstraction: diff --git a/_zh-cn/overviews/scala3-book/ca-implicit-conversions.md b/_zh-cn/overviews/scala3-book/ca-implicit-conversions.md index 670940e4f6..e79c252822 100644 --- a/_zh-cn/overviews/scala3-book/ca-implicit-conversions.md +++ b/_zh-cn/overviews/scala3-book/ca-implicit-conversions.md @@ -5,6 +5,11 @@ description: This page demonstrates how to implement Implicit Conversions in Sca num: 66 previous-page: ca-multiversal-equality next-page: ca-summary + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- 隐式转换由 `scala.Conversion` 类的 `given` 实例定义。 diff --git a/_zh-cn/overviews/scala3-book/ca-multiversal-equality.md b/_zh-cn/overviews/scala3-book/ca-multiversal-equality.md index cc42901a49..02170a260a 100644 --- a/_zh-cn/overviews/scala3-book/ca-multiversal-equality.md +++ b/_zh-cn/overviews/scala3-book/ca-multiversal-equality.md @@ -5,6 +5,11 @@ description: This page demonstrates how to implement Multiversal Equality in Sca num: 65 previous-page: ca-type-classes next-page: ca-implicit-conversions + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/ca-summary.md b/_zh-cn/overviews/scala3-book/ca-summary.md index 5b9b1c147d..04381a0ede 100644 --- a/_zh-cn/overviews/scala3-book/ca-summary.md +++ b/_zh-cn/overviews/scala3-book/ca-summary.md @@ -5,6 +5,11 @@ description: This page provides a summary of the Contextual Abstractions lessons num: 67 previous-page: ca-implicit-conversions next-page: concurrency + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/ca-type-classes.md b/_zh-cn/overviews/scala3-book/ca-type-classes.md index 173361e33f..5cef98e383 100644 --- a/_zh-cn/overviews/scala3-book/ca-type-classes.md +++ b/_zh-cn/overviews/scala3-book/ca-type-classes.md @@ -5,6 +5,11 @@ description: This page demonstrates how to create and use type classes in Scala num: 64 previous-page: ca-extension-methods next-page: ca-multiversal-equality + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -105,4 +110,4 @@ trait HasLegs[A]: 有关如何在 Scala 3 中使用类型类的真实示例,请参阅[多元相等性部分][multiversal]中的 `CanEqual` 讨论。 -[multiversal]: {% link _overviews/scala3-book/ca-multiversal-equality.md %} +[multiversal]: {% link _zh-cn/overviews/scala3-book/ca-multiversal-equality.md %} diff --git a/_zh-cn/overviews/scala3-book/collections-classes.md b/_zh-cn/overviews/scala3-book/collections-classes.md index dd88184c28..2b494d7791 100644 --- a/_zh-cn/overviews/scala3-book/collections-classes.md +++ b/_zh-cn/overviews/scala3-book/collections-classes.md @@ -5,6 +5,11 @@ description: This page introduces the common Scala 3 collections types and some num: 37 previous-page: collections-intro next-page: collections-methods + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/collections-intro.md b/_zh-cn/overviews/scala3-book/collections-intro.md index e8ee13baed..2b8f83481e 100644 --- a/_zh-cn/overviews/scala3-book/collections-intro.md +++ b/_zh-cn/overviews/scala3-book/collections-intro.md @@ -5,6 +5,11 @@ description: This page provides and introduction to the common collections class num: 36 previous-page: packaging-imports next-page: collections-classes + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/collections-methods.md b/_zh-cn/overviews/scala3-book/collections-methods.md index 9a47151843..518754ad37 100644 --- a/_zh-cn/overviews/scala3-book/collections-methods.md +++ b/_zh-cn/overviews/scala3-book/collections-methods.md @@ -5,6 +5,11 @@ description: This page demonstrates the common methods on the Scala 3 collection num: 38 previous-page: collections-classes next-page: collections-summary + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -393,9 +398,9 @@ res1: Int = 24 > 通过这样做,您可以在 `for` 表达式中使用这些集合,还可以利用 Scala 的函数式集合方法。 > 请参阅 [与 Java 交互][interacting] 部分了解更多详细信息。 -[interacting]: {% link _overviews/scala3-book/interacting-with-java.md %} -[lambdas]: {% link _overviews/scala3-book/fun-anonymous-functions.md %} -[fp-intro]: {% link _overviews/scala3-book/fp-intro.md %} +[interacting]: {% link _zh-cn/overviews/scala3-book/interacting-with-java.md %} +[lambdas]: {% link _zh-cn/overviews/scala3-book/fun-anonymous-functions.md %} +[fp-intro]: {% link _zh-cn/overviews/scala3-book/fp-intro.md %} [mut-immut-colls]: {% link _overviews/collections-2.13/overview.md %} [architecture]: {% link _overviews/core/architecture-of-scala-213-collections.md %} diff --git a/_zh-cn/overviews/scala3-book/collections-summary.md b/_zh-cn/overviews/scala3-book/collections-summary.md index 4a47cb2ffd..45456d2557 100644 --- a/_zh-cn/overviews/scala3-book/collections-summary.md +++ b/_zh-cn/overviews/scala3-book/collections-summary.md @@ -5,6 +5,11 @@ description: This page provides a summary of the Collections chapter. num: 39 previous-page: collections-methods next-page: fp-intro + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/concurrency.md b/_zh-cn/overviews/scala3-book/concurrency.md index fd9dbbbbcd..cd2b7e8fde 100644 --- a/_zh-cn/overviews/scala3-book/concurrency.md +++ b/_zh-cn/overviews/scala3-book/concurrency.md @@ -5,6 +5,11 @@ description: This page discusses how Scala concurrency works, with an emphasis o num: 68 previous-page: ca-summary next-page: scala-tools + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/control-structures.md b/_zh-cn/overviews/scala3-book/control-structures.md index 0dfa1b845a..d552145c19 100644 --- a/_zh-cn/overviews/scala3-book/control-structures.md +++ b/_zh-cn/overviews/scala3-book/control-structures.md @@ -5,6 +5,11 @@ description: This page provides an introduction to Scala's control structures, i num: 18 previous-page: first-look-at-types next-page: domain-modeling-intro + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/domain-modeling-fp.md b/_zh-cn/overviews/scala3-book/domain-modeling-fp.md index d89e51ca76..c218cb5439 100644 --- a/_zh-cn/overviews/scala3-book/domain-modeling-fp.md +++ b/_zh-cn/overviews/scala3-book/domain-modeling-fp.md @@ -5,6 +5,11 @@ description: This chapter provides an introduction to FP domain modeling with Sc num: 22 previous-page: domain-modeling-oop next-page: methods-intro + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -473,5 +478,5 @@ Pizza(Small, Thin, Seq(Cheese)) - 您可以使用“函数对象”方法并将方法存储在定义的数据类型上 - 您可以使用扩展方法把函数装配到数据模型上 -[adts]: {% link _overviews/scala3-book/types-adts-gadts.md %} -[modeling-tools]: {% link _overviews/scala3-book/domain-modeling-tools.md %} +[adts]: {% link _zh-cn/overviews/scala3-book/types-adts-gadts.md %} +[modeling-tools]: {% link _zh-cn/overviews/scala3-book/domain-modeling-tools.md %} diff --git a/_zh-cn/overviews/scala3-book/domain-modeling-intro.md b/_zh-cn/overviews/scala3-book/domain-modeling-intro.md index eb63b37efb..f2924f69a7 100644 --- a/_zh-cn/overviews/scala3-book/domain-modeling-intro.md +++ b/_zh-cn/overviews/scala3-book/domain-modeling-intro.md @@ -5,6 +5,11 @@ description: This chapter provides an introduction to domain modeling in Scala 3 num: 19 previous-page: control-structures next-page: domain-modeling-tools + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- 本章介绍如何使用 Scala 3 对周围的世界进行建模: diff --git a/_zh-cn/overviews/scala3-book/domain-modeling-oop.md b/_zh-cn/overviews/scala3-book/domain-modeling-oop.md index 92b9c86597..47a238c169 100644 --- a/_zh-cn/overviews/scala3-book/domain-modeling-oop.md +++ b/_zh-cn/overviews/scala3-book/domain-modeling-oop.md @@ -5,6 +5,11 @@ description: This chapter provides an introduction to OOP domain modeling with S num: 21 previous-page: domain-modeling-tools next-page: domain-modeling-fp + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/domain-modeling-tools.md b/_zh-cn/overviews/scala3-book/domain-modeling-tools.md index d4e1f8979c..1cfcaab10d 100644 --- a/_zh-cn/overviews/scala3-book/domain-modeling-tools.md +++ b/_zh-cn/overviews/scala3-book/domain-modeling-tools.md @@ -5,6 +5,11 @@ description: This chapter provides an introduction to the available domain model num: 20 previous-page: domain-modeling-intro next-page: domain-modeling-oop + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- Scala 3提供了许多不同的结构,因此我们可以对周围的世界进行建模: @@ -693,8 +698,8 @@ def handleMessages(message: Message): Unit = message match ``` [ref-enums]: {{ site.scala3ref }}/enums/enums.html -[adts]: {% link _overviews/scala3-book/types-adts-gadts.md %} -[fp-modeling]: {% link _overviews/scala3-book/domain-modeling-fp.md %} +[adts]: {% link _zh-cn/overviews/scala3-book/types-adts-gadts.md %} +[fp-modeling]: {% link _zh-cn/overviews/scala3-book/domain-modeling-fp.md %} [creator]: {{ site.scala3ref }}/other-new-features/creator-applications.html [unapply]: {{ site.scala3ref }}/changed-features/pattern-matching.html [trait-params]: {{ site.scala3ref }}/other-new-features/trait-parameters.html diff --git a/_zh-cn/overviews/scala3-book/first-look-at-types.md b/_zh-cn/overviews/scala3-book/first-look-at-types.md index adc9ebd91c..5cc496806c 100644 --- a/_zh-cn/overviews/scala3-book/first-look-at-types.md +++ b/_zh-cn/overviews/scala3-book/first-look-at-types.md @@ -5,6 +5,11 @@ description: This page provides a brief introduction to Scala's built-in data ty num: 17 previous-page: taste-summary next-page: control-structures + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -264,6 +269,6 @@ val z: Long = y // Error [reference]: {{ site.scala3ref }}/overview.html [matchable]: {{ site.scala3ref }}/other-new-features/matchable.html [interpolation]: {% link _overviews/core/string-interpolation.md %} -[fp]: {% link _overviews/scala3-book/fp-intro.md %} +[fp]: {% link _zh-cn/overviews/scala3-book/fp-intro.md %} [option-api]: https://scala-lang.org/api/3.x/scala/Option.html [safe-null]: {{ site.scala3ref }}/experimental/explicit-nulls.html diff --git a/_zh-cn/overviews/scala3-book/fp-functional-error-handling.md b/_zh-cn/overviews/scala3-book/fp-functional-error-handling.md index effde2f6c8..d0c2dd8749 100644 --- a/_zh-cn/overviews/scala3-book/fp-functional-error-handling.md +++ b/_zh-cn/overviews/scala3-book/fp-functional-error-handling.md @@ -5,6 +5,11 @@ description: This section provides an introduction to functional error handling num: 45 previous-page: fp-functions-are-values next-page: fp-summary + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/fp-functions-are-values.md b/_zh-cn/overviews/scala3-book/fp-functions-are-values.md index a4e3c6df72..e6ad2bcac3 100644 --- a/_zh-cn/overviews/scala3-book/fp-functions-are-values.md +++ b/_zh-cn/overviews/scala3-book/fp-functions-are-values.md @@ -5,6 +5,11 @@ description: This section looks at the use of functions as values in functional num: 44 previous-page: fp-pure-functions next-page: fp-functional-error-handling + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -95,5 +100,5 @@ nums.sortWith(_ > _) // List(11, 7, 5, 3, 1) nums.takeWhile(_ < 6).sortWith(_ < _) // List(1, 3, 5) ``` -[hofs]: {% link _overviews/scala3-book/fun-hofs.md %} -[eta]: {% link _overviews/scala3-book/fun-eta-expansion.md %} +[hofs]: {% link _zh-cn/overviews/scala3-book/fun-hofs.md %} +[eta]: {% link _zh-cn/overviews/scala3-book/fun-eta-expansion.md %} diff --git a/_zh-cn/overviews/scala3-book/fp-immutable-values.md b/_zh-cn/overviews/scala3-book/fp-immutable-values.md index 885de5c4c9..085161228f 100644 --- a/_zh-cn/overviews/scala3-book/fp-immutable-values.md +++ b/_zh-cn/overviews/scala3-book/fp-immutable-values.md @@ -5,6 +5,11 @@ description: This section looks at the use of immutable values in functional pro num: 42 previous-page: fp-what-is-fp next-page: fp-pure-functions + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -66,4 +71,4 @@ val elton = reginald.copy( > 根据您的需要,您可以创建枚举、traits 或类,而不是 `case` 类。 > 有关详细信息,请参阅[数据建模][modeling]一章。 -[modeling]: {% link _overviews/scala3-book/domain-modeling-intro.md %} +[modeling]: {% link _zh-cn/overviews/scala3-book/domain-modeling-intro.md %} diff --git a/_zh-cn/overviews/scala3-book/fp-intro.md b/_zh-cn/overviews/scala3-book/fp-intro.md index 83e1c6c08e..5af0f94021 100644 --- a/_zh-cn/overviews/scala3-book/fp-intro.md +++ b/_zh-cn/overviews/scala3-book/fp-intro.md @@ -5,6 +5,11 @@ description: This chapter provides an introduction to functional programming in num: 40 previous-page: collections-summary next-page: fp-what-is-fp + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/fp-pure-functions.md b/_zh-cn/overviews/scala3-book/fp-pure-functions.md index 3a88f34431..6e53e0f705 100644 --- a/_zh-cn/overviews/scala3-book/fp-pure-functions.md +++ b/_zh-cn/overviews/scala3-book/fp-pure-functions.md @@ -5,6 +5,11 @@ description: This section looks at the use of pure functions in functional progr num: 43 previous-page: fp-immutable-values next-page: fp-functions-are-values + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -103,4 +108,4 @@ def sum(xs: List[Int]): Int = xs match 第二个要点是每个现实世界的应用程序都与外部世界交互。 因此,考虑函数式程序的一种简化方法是,它们由一个纯函数核心组成,其他一些函数把这些纯函数包装起来与外部世界交互。 -[eta]: {% link _overviews/scala3-book/fun-eta-expansion.md %} +[eta]: {% link _zh-cn/overviews/scala3-book/fun-eta-expansion.md %} diff --git a/_zh-cn/overviews/scala3-book/fp-summary.md b/_zh-cn/overviews/scala3-book/fp-summary.md index 47a3019a51..5eb64f228a 100644 --- a/_zh-cn/overviews/scala3-book/fp-summary.md +++ b/_zh-cn/overviews/scala3-book/fp-summary.md @@ -5,6 +5,11 @@ description: This section summarizes the previous functional programming section num: 46 previous-page: fp-functional-error-handling next-page: types-introduction + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/fp-what-is-fp.md b/_zh-cn/overviews/scala3-book/fp-what-is-fp.md index 314b39fce5..c7f05298a1 100644 --- a/_zh-cn/overviews/scala3-book/fp-what-is-fp.md +++ b/_zh-cn/overviews/scala3-book/fp-what-is-fp.md @@ -5,6 +5,11 @@ description: This section provides an answer to the question, what is functional num: 41 previous-page: fp-intro next-page: fp-immutable-values + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/fun-anonymous-functions.md b/_zh-cn/overviews/scala3-book/fun-anonymous-functions.md index e4576252bf..25de7d14c7 100644 --- a/_zh-cn/overviews/scala3-book/fun-anonymous-functions.md +++ b/_zh-cn/overviews/scala3-book/fun-anonymous-functions.md @@ -5,6 +5,11 @@ description: This page shows how to use anonymous functions in Scala, including num: 28 previous-page: fun-intro next-page: fun-function-variables + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/fun-eta-expansion.md b/_zh-cn/overviews/scala3-book/fun-eta-expansion.md index daff0b8d25..bca25ec8fd 100644 --- a/_zh-cn/overviews/scala3-book/fun-eta-expansion.md +++ b/_zh-cn/overviews/scala3-book/fun-eta-expansion.md @@ -5,6 +5,11 @@ description: This page discusses Eta Expansion, the Scala technology that automa num: 30 previous-page: fun-function-variables next-page: fun-hofs + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -79,5 +84,5 @@ val methods = List(isEvenMethod) // works 有关其工作原理的更多详细信息,请参阅参考文档中的 [Eta 扩展页面][eta_expansion]。 [eta_expansion]: {{ site.scala3ref }}/changed-features/eta-expansion.html -[extension]: {% link _overviews/scala3-book/ca-extension-methods.md %} -[toplevel]: {% link _overviews/scala3-book/taste-toplevel-definitions.md %} +[extension]: {% link _zh-cn/overviews/scala3-book/ca-extension-methods.md %} +[toplevel]: {% link _zh-cn/overviews/scala3-book/taste-toplevel-definitions.md %} diff --git a/_zh-cn/overviews/scala3-book/fun-function-variables.md b/_zh-cn/overviews/scala3-book/fun-function-variables.md index d92c0610db..75d164d0e9 100644 --- a/_zh-cn/overviews/scala3-book/fun-function-variables.md +++ b/_zh-cn/overviews/scala3-book/fun-function-variables.md @@ -5,6 +5,11 @@ description: This page shows how to use anonymous functions in Scala, including num: 29 previous-page: fun-anonymous-functions next-page: fun-eta-expansion + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -109,4 +114,4 @@ functionMap: Map[String, Int => Int] 并且由于 Scala 3 中改进的 [Eta Expansion][eta_expansion] 函数式,您可以以相同的方式处理 *方法*。 -[eta_expansion]: {% link _overviews/scala3-book/fun-eta-expansion.md %} +[eta_expansion]: {% link _zh-cn/overviews/scala3-book/fun-eta-expansion.md %} diff --git a/_zh-cn/overviews/scala3-book/fun-hofs.md b/_zh-cn/overviews/scala3-book/fun-hofs.md index 5fd9bb9c72..b20c6212da 100644 --- a/_zh-cn/overviews/scala3-book/fun-hofs.md +++ b/_zh-cn/overviews/scala3-book/fun-hofs.md @@ -5,6 +5,11 @@ description: This page demonstrates how to create and use higher-order functions num: 31 previous-page: fun-eta-expansion next-page: fun-write-map-function + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -285,4 +290,4 @@ def executeAndPrint(f: (Int, Int) => Int, ... 一旦你熟悉了这种语法,你就会用它来定义函数参数、匿名函数和函数变量,而且当你阅读 Scaladoc 中有关高阶函数的内容时,这些内容变得更容易了。 -[eta_expansion]: {% link _overviews/scala3-book/fun-eta-expansion.md %} +[eta_expansion]: {% link _zh-cn/overviews/scala3-book/fun-eta-expansion.md %} diff --git a/_zh-cn/overviews/scala3-book/fun-intro.md b/_zh-cn/overviews/scala3-book/fun-intro.md index 2935e0b0e1..4a84ebf631 100644 --- a/_zh-cn/overviews/scala3-book/fun-intro.md +++ b/_zh-cn/overviews/scala3-book/fun-intro.md @@ -5,6 +5,11 @@ description: This chapter looks at all topics related to functions in Scala 3. num: 27 previous-page: methods-summary next-page: fun-anonymous-functions + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- 上一章介绍了 Scala *方法*,本章深入研究 *函数*。 diff --git a/_zh-cn/overviews/scala3-book/fun-summary.md b/_zh-cn/overviews/scala3-book/fun-summary.md index 017d9d1742..f05694ee42 100644 --- a/_zh-cn/overviews/scala3-book/fun-summary.md +++ b/_zh-cn/overviews/scala3-book/fun-summary.md @@ -5,6 +5,11 @@ description: This page shows how to use anonymous functions in Scala, including num: 34 previous-page: fun-write-method-returns-function next-page: packaging-imports + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/fun-write-map-function.md b/_zh-cn/overviews/scala3-book/fun-write-map-function.md index 6c97135a5f..8240830912 100644 --- a/_zh-cn/overviews/scala3-book/fun-write-map-function.md +++ b/_zh-cn/overviews/scala3-book/fun-write-map-function.md @@ -5,6 +5,11 @@ description: This page demonstrates how to create and use higher-order functions num: 32 previous-page: fun-hofs next-page: fun-write-method-returns-function + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/fun-write-method-returns-function.md b/_zh-cn/overviews/scala3-book/fun-write-method-returns-function.md index fc7dbf7a4f..5e223041d5 100644 --- a/_zh-cn/overviews/scala3-book/fun-write-method-returns-function.md +++ b/_zh-cn/overviews/scala3-book/fun-write-method-returns-function.md @@ -5,6 +5,11 @@ description: This page demonstrates how to create and use higher-order functions num: 33 previous-page: fun-write-map-function next-page: fun-summary + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/interacting-with-java.md b/_zh-cn/overviews/scala3-book/interacting-with-java.md index d13ac7635f..dae978ba6e 100644 --- a/_zh-cn/overviews/scala3-book/interacting-with-java.md +++ b/_zh-cn/overviews/scala3-book/interacting-with-java.md @@ -5,6 +5,11 @@ description: This page demonstrates how Scala code can interact with Java, and h num: 72 previous-page: tools-worksheets next-page: scala-for-java-devs + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- ## 介绍 diff --git a/_zh-cn/overviews/scala3-book/introduction.md b/_zh-cn/overviews/scala3-book/introduction.md index 21d8562dc2..003e2e3987 100644 --- a/_zh-cn/overviews/scala3-book/introduction.md +++ b/_zh-cn/overviews/scala3-book/introduction.md @@ -6,7 +6,6 @@ num: 1 previous-page: next-page: scala-features -scala3: true partof: scala3-book overview-name: "Scala 3 — Book" layout: multipage-overview @@ -17,14 +16,19 @@ permalink: "/zh-cn/scala3/book/:title.html" 本书的目标是提供对 Scala 语言的非正式介绍,并以相对轻松的方式涉及所有的 Scala 主题。 若您在阅读本书时想了解有关特定功能的更多信息,可以随时参阅[_参考文档_][reference],其中更详细地涵盖了 Scala 语言的许多新特性。 +
+  如果你有兴趣看本书的 Scala 2 版,你可以在这获得。 +我们目前在整合这两本书,你可以帮助我们。 +
+ 在本书中,我们希望证明 Scala 是一种优美的、富有表现力的编程语言。它具有简洁、现代的语法,支持函数式编程(FP)和面向对象编程(OOP),并提供安全的静态类型系统。 Scala 的语法和特性都经过了重新思考与公开辩论,并在2020年更新,比以往任何时候都更清晰、更容易理解。 本书首先在[“品味 Scala”部分][taste]对 Scala 的许多特性进行了一次“旋风之旅”。随后的章节会提供有关这些语言特性的更多详细信息。 -> 我们仍在撰写本书的过程中。 -> 您可以[帮助我们改进][contributing] +{% comment %} +We should have a link structure on the whole tour here +{% endcomment %} -[contributing]: {% link scala3/contribute-to-docs.md %} [reference]: {{ site.scala3ref }}/overview.html -[taste]: {% link _overviews/scala3-book/taste-intro.md %} +[taste]: {% link _zh-cn/overviews/scala3-book/taste-intro.md %} diff --git a/_zh-cn/overviews/scala3-book/methods-intro.md b/_zh-cn/overviews/scala3-book/methods-intro.md index bba0ebfe1c..f6d66d0686 100644 --- a/_zh-cn/overviews/scala3-book/methods-intro.md +++ b/_zh-cn/overviews/scala3-book/methods-intro.md @@ -5,6 +5,11 @@ description: This section introduces methods in Scala 3. num: 23 previous-page: domain-modeling-fp next-page: methods-most + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/methods-main-methods.md b/_zh-cn/overviews/scala3-book/methods-main-methods.md index 0457b45cc7..fda3199aca 100644 --- a/_zh-cn/overviews/scala3-book/methods-main-methods.md +++ b/_zh-cn/overviews/scala3-book/methods-main-methods.md @@ -5,6 +5,11 @@ description: This page describes how 'main' methods and the '@main' annotation w num: 25 previous-page: methods-most next-page: methods-summary + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/methods-most.md b/_zh-cn/overviews/scala3-book/methods-most.md index 79e31c55bb..d9ad8e194d 100644 --- a/_zh-cn/overviews/scala3-book/methods-most.md +++ b/_zh-cn/overviews/scala3-book/methods-most.md @@ -5,6 +5,11 @@ description: This section introduces Scala 3 methods, including main methods, ex num: 24 previous-page: methods-intro next-page: methods-main-methods + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -380,7 +385,7 @@ aCircle.area 有关这些功能的更多详细信息,请参阅 [参考文档][reference]。 -[extension]: {% link _overviews/scala3-book/ca-extension-methods.md %} +[extension]: {% link _zh-cn/overviews/scala3-book/ca-extension-methods.md %} [reference_extension_methods]: {{ site.scala3ref }}/contextual/extension-methods.html [reference]: {{ site.scala3ref }}/overview.html [reference_matchable]: {{ site.scala3ref }}/other-new-features/matchable.html diff --git a/_zh-cn/overviews/scala3-book/methods-summary.md b/_zh-cn/overviews/scala3-book/methods-summary.md index 6bea602874..c74f976cd2 100644 --- a/_zh-cn/overviews/scala3-book/methods-summary.md +++ b/_zh-cn/overviews/scala3-book/methods-summary.md @@ -5,6 +5,11 @@ description: This section summarizes the previous sections on Scala 3 methods. num: 26 previous-page: methods-main-methods next-page: fun-intro + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/packaging-imports.md b/_zh-cn/overviews/scala3-book/packaging-imports.md index a4adc04ba8..c87cc51b3d 100644 --- a/_zh-cn/overviews/scala3-book/packaging-imports.md +++ b/_zh-cn/overviews/scala3-book/packaging-imports.md @@ -5,6 +5,11 @@ description: A discussion of using packages and imports to organize your code, b num: 35 previous-page: fun-summary next-page: collections-intro + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -375,4 +380,4 @@ def genericMonthConverter[A](a: A)(using monthConverter: MonthConverter[A]): Str 如前所述, `import given` 语法的主要设计优势之一是明确范围内的给定来自何处,并且在这些 `import` 语句中,很清楚地表明给定是来自 `MonthConversions` 对象。 -[contextual]: {% link _overviews/scala3-book/ca-contextual-abstractions-intro.md %} +[contextual]: {% link _zh-cn/overviews/scala3-book/ca-contextual-abstractions-intro.md %} diff --git a/_zh-cn/overviews/scala3-book/scala-features.md b/_zh-cn/overviews/scala3-book/scala-features.md index d5e1ccef3e..6d9362cf6b 100644 --- a/_zh-cn/overviews/scala3-book/scala-features.md +++ b/_zh-cn/overviews/scala3-book/scala-features.md @@ -4,15 +4,15 @@ type: chapter description: This page discusses the main features of the Scala 3 programming language. num: 2 previous-page: introduction -next-page: +next-page: why-scala-3 -scala3: true partof: scala3-book overview-name: "Scala 3 — Book" layout: multipage-overview permalink: "/zh-cn/scala3/book/:title.html" --- + {% comment %} The name _Scala_ comes from the word _scalable_, and true to that name, the Scala language is used to power busy websites and analyze huge data sets. This section introduces the features that make Scala a scalable language. @@ -113,17 +113,38 @@ That is, we don’t write imperative code like this: 正如函数式编程的说法,在 Scala 中,您编写您想要 _“什么”_,而不是 _“如何”_ 去实现它。 也就是说,我们不会像这样编写命令式代码: +{% tabs scala-features-1 class=tabs-scala-version %} +{% tab 'Scala 2' for=scala-features-1 %} ```scala +import scala.collection.mutable.ListBuffer + def double(ints: List[Int]): List[Int] = { val buffer = new ListBuffer[Int]() for (i <- ints) { - buffer += i * 2 + buffer += i * 2 } buffer.toList } +val oldNumbers = List(1, 2, 3) +val newNumbers = double(oldNumbers) +``` +{% endtab %} +{% tab 'Scala 3' for=scala-features-1 %} +```scala +import scala.collection.mutable.ListBuffer + +def double(ints: List[Int]): List[Int] = + val buffer = new ListBuffer[Int]() + for i <- ints do + buffer += i * 2 + buffer.toList + +val oldNumbers = List(1, 2, 3) val newNumbers = double(oldNumbers) ``` +{% endtab %} +{% endtabs %} {% comment %} That code instructs the compiler what to do on a step-by-step basis. @@ -133,9 +154,13 @@ Instead, we write high-level, functional code using higher-order functions and l 这段代码指示编译器逐步执行特定操作。 相反,我们使用像这样的高阶函数与 lambda 来编写高层次的函数式代码以计算出相同的结果: +{% tabs scala-features-2 %} +{% tab 'Scala 2 and 3' for=scala-features-2 %} ```scala val newNumbers = oldNumbers.map(_ * 2) ``` +{% endtab %} +{% endtabs %} {% comment %} As you can see, that code is much more concise, easier to read, and easier to maintain. @@ -158,10 +183,15 @@ For instance, variables are created concisely, and their types are clear: Scala 具有简明易读的语法。例如,变量的创建十分简洁,其类型也很明确。 +{% tabs scala-features-3 %} +{% tab 'Scala 2 and 3' for=scala-features-3 %} ```scala val nums = List(1,2,3) val p = Person("Martin", "Odersky") ``` +{% endtab %} +{% endtabs %} + {% comment %} Higher-order functions and lambdas make for concise code that’s readable: @@ -169,6 +199,8 @@ Higher-order functions and lambdas make for concise code that’s readable: 高阶函数与 lambda 使代码简明易读: +{% tabs scala-features-4 %} +{% tab 'Scala 2 and 3' for=scala-features-4 %} ```scala nums.map(i => i * 2) // long form nums.map(_ * 2) // short form @@ -176,6 +208,8 @@ nums.map(_ * 2) // short form nums.filter(i => i > 1) nums.filter(_ > 1) ``` +{% endtab %} +{% endtabs %} {% comment %} Traits, classes, and methods are defined with a clean, light syntax: @@ -183,6 +217,24 @@ Traits, classes, and methods are defined with a clean, light syntax: 特质(Traits)、类(Class)和方法(Method)都是用简洁、轻巧的语法定义的。 +{% tabs scala-features-5 class=tabs-scala-version %} +{% tab 'Scala 2' for=scala-features-5 %} +```scala mdoc +trait Animal { + def speak(): Unit +} + +trait HasTail { + def wagTail(): Unit +} + +class Dog extends Animal with HasTail { + def speak(): Unit = println("Woof") + def wagTail(): Unit = println("⎞⎜⎛ ⎞⎜⎛") +} +``` +{% endtab %} +{% tab 'Scala 3' for=scala-features-5 %} ```scala trait Animal: def speak(): Unit @@ -191,9 +243,12 @@ trait HasTail: def wagTail(): Unit class Dog extends Animal, HasTail: - def speak() = println("Woof") - def wagTail() = println("⎞⎜⎛ ⎞⎜⎛") + def speak(): Unit = println("Woof") + def wagTail(): Unit = println("⎞⎜⎛ ⎞⎜⎛") ``` +{% endtab %} +{% endtabs %} + {% comment %} Studies have shown that the time a developer spends _reading_ code to _writing_ code is at least a 10:1 ratio, so writing code that is concise _and_ readable is important. @@ -216,15 +271,32 @@ All of these expressions look like a dynamically-typed language like Python or R Scala 是一种静态类型的语言,但由于其类型推断能力,它使人感觉是动态的。所有这些表达式看起来都像 Python 或 Ruby 这样的动态类型语言代码,但其实它们都是 Scala 代码: +{% tabs scala-features-6 class=tabs-scala-version %} +{% tab 'Scala 2' for=scala-features-6 %} ```scala val s = "Hello" val p = Person("Al", "Pacino") -val sum = ints.reduceLeft(_ + _) +val sum = nums.reduceLeft(_ + _) +val y = for (i <- nums) yield i * 2 +val z = nums + .filter(_ > 100) + .filter(_ < 10_000) + .map(_ * 2) +``` +{% endtab %} +{% tab 'Scala 3' for=scala-features-6 %} +```scala +val s = "Hello" +val p = Person("Al", "Pacino") +val sum = nums.reduceLeft(_ + _) val y = for i <- nums yield i * 2 -val z = nums.filter(_ > 100) - .filter(_ < 10_000) - .map(_ * 2) +val z = nums + .filter(_ > 100) + .filter(_ < 10_000) + .map(_ * 2) ``` +{% endtab %} +{% endtabs %} {% comment %} As Heather Miller states, Scala is considered to be a [strong, statically-typed language](https://heather.miller.am/blog/types-in-scala.html), and you get all the benefits of static types: @@ -313,19 +385,19 @@ Scala 的类型系统在编译时强制要求以安全与连贯的方式使用 - [Inner classes](/tour/inner-classes.html) and [abstract type members](/tour/abstract-type-members.html) as object members {% endcomment %} -- [推断类型]({% link _overviews/scala3-book/types-inferred.md %}) -- [泛型类]({% link _overviews/scala3-book/types-generics.md %}) -- [型变]({% link _overviews/scala3-book/types-variance.md %}) +- [推断类型]({% link _zh-cn/overviews/scala3-book/types-inferred.md %}) +- [泛型类]({% link _zh-cn/overviews/scala3-book/types-generics.md %}) +- [型变]({% link _zh-cn/overviews/scala3-book/types-variance.md %}) - [类型上界](/tour/upper-type-bounds.html) 与 [类型下界](/tour/lower-type-bounds.html) - [多态方法](/tour/polymorphic-methods.html) -- [交叉类型]({% link _overviews/scala3-book/types-intersection.md %}) -- [联合类型]({% link _overviews/scala3-book/types-union.md %}) +- [交叉类型]({% link _zh-cn/overviews/scala3-book/types-intersection.md %}) +- [联合类型]({% link _zh-cn/overviews/scala3-book/types-union.md %}) - [类型 Lambda]({{ site.scala3ref }}/new-types/type-lambdas.html) -- [`given` 实例与 `using` 子句]({% link _overviews/scala3-book/ca-given-using-clauses.md %}) -- [扩展方法]({% link _overviews/scala3-book/ca-extension-methods.md %}) -- [类型类]({% link _overviews/scala3-book/ca-type-classes.md %}) -- [多元相等]({% link _overviews/scala3-book/ca-multiversal-equality.md %}) -- [不透明类型别名]({% link _overviews/scala3-book/types-opaque-types.md %}) +- [`given` 实例与 `using` 子句]({% link _zh-cn/overviews/scala3-book/ca-given-using-clauses.md %}) +- [扩展方法]({% link _zh-cn/overviews/scala3-book/ca-extension-methods.md %}) +- [类型类]({% link _zh-cn/overviews/scala3-book/ca-type-classes.md %}) +- [多元相等]({% link _zh-cn/overviews/scala3-book/ca-multiversal-equality.md %}) +- [不透明类型别名]({% link _zh-cn/overviews/scala3-book/types-opaque-types.md %}) - [开放类]({{ site.scala3ref }}/other-new-features/open-classes.html) - [匹配类型]({{ site.scala3ref }}/new-types/match-types.html) - [依赖函数类型]({{ site.scala3ref }}/new-types/dependent-function-types.html) @@ -520,11 +592,15 @@ For instance, in Scala you can read files with a Java `BufferedReader` and `File 对于第一点来说,Scala 应用程序中每天都会用到 Java 类和库。 例如,在 Scala 中,您可以使用 Java 的 `BufferedReader` 和 `FileReader` 来读取文件: +{% tabs scala-features-7 %} +{% tab 'Scala 2 and 3' for=scala-features-7 %} ```scala import java.io.* val br = BufferedReader(FileReader(filename)) // read the file with `br` ... ``` +{% endtab %} +{% endtabs %} {% comment %} Using Java code in Scala is generally seamless. @@ -536,11 +612,14 @@ Java collections can also be used in Scala, and if you want to use Scala’s ric Java 集合也可以在 Scala 中使用, 如果您想将 Scala 丰富的集合类方法与其一起使用,只需几行代码即可转换它们: - +{% tabs scala-features-8 %} +{% tab 'Scala 2 and 3' for=scala-features-8 %} ```scala import scala.jdk.CollectionConverters.* val scalaList: Seq[Integer] = JavaClass.getJavaList().asScala.toSeq ``` +{% endtab %} +{% endtabs %} {% comment %} @@ -882,10 +961,7 @@ As this page shows, Scala has many terrific programming language features at a h [reference]: {{ site.scala3ref }}/overview.html -[multiversal]: {% link _overviews/scala3-book/ca-multiversal-equality.md %} -[extension]: {% link _overviews/scala3-book/ca-extension-methods.md %} -[givens]: {% link _overviews/scala3-book/ca-given-using-clauses.md %} -[opaque_types]: {% link _overviews/scala3-book/types-opaque-types.md %} - - - +[multiversal]: {% link _zh-cn/overviews/scala3-book/ca-multiversal-equality.md %} +[extension]: {% link _zh-cn/overviews/scala3-book/ca-extension-methods.md %} +[givens]: {% link _zh-cn/overviews/scala3-book/ca-given-using-clauses.md %} +[opaque_types]: {% link _zh-cn/overviews/scala3-book/types-opaque-types.md %} diff --git a/_zh-cn/overviews/scala3-book/scala-for-java-devs.md b/_zh-cn/overviews/scala3-book/scala-for-java-devs.md index cf733b0275..c659559bb2 100644 --- a/_zh-cn/overviews/scala3-book/scala-for-java-devs.md +++ b/_zh-cn/overviews/scala3-book/scala-for-java-devs.md @@ -5,6 +5,11 @@ description: This page is for Java developers who are interested in learning abo num: 73 previous-page: interacting-with-java next-page: scala-for-javascript-devs + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -1245,29 +1250,29 @@ Scala 中还有其他一些概念目前在 Java 11 中是没有的。 - 宏和元编程 -[collections-classes]: {% link _overviews/scala3-book/collections-classes.md %} -[collections-methods]: {% link _overviews/scala3-book/collections-methods.md %} -[control]: {% link _overviews/scala3-book/control-structures.md %} -[equality]: {% link _overviews/scala3-book/ca-multiversal-equality.md %} -[error-handling]: {% link _overviews/scala3-book/fp-functional-error-handling.md %} -[extension-methods]: {% link _overviews/scala3-book/ca-extension-methods.md %} -[givens]: {% link _overviews/scala3-book/ca-given-using-clauses.md %} -[hofs]: {% link _overviews/scala3-book/fun-hofs.md %} -[imports]: {% link _overviews/scala3-book/packaging-imports.md %} -[modeling-intro]: {% link _overviews/scala3-book/domain-modeling-intro.md %} -[modeling-oop]: {% link _overviews/scala3-book/domain-modeling-oop.md %} -[opaque]: {% link _overviews/scala3-book/types-opaque-types.md %} -[tools]: {% link _overviews/scala3-book/scala-tools.md %} -[toplevel]: {% link _overviews/scala3-book/taste-toplevel-definitions.md %} -[type-classes]: {% link _overviews/scala3-book/ca-type-classes.md %} - -[concurrency]: {% link _overviews/scala3-book/concurrency.md %} -[contextual]: {% link _overviews/scala3-book/ca-contextual-abstractions-intro.md %} -[control]: {% link _overviews/scala3-book/control-structures.md %} -[fp-intro]: {% link _overviews/scala3-book/fp-intro.md %} -[intersection-types]: {% link _overviews/scala3-book/types-intersection.md %} -[modeling-fp]: {% link _overviews/scala3-book/domain-modeling-fp.md %} -[multiversal]: {% link _overviews/scala3-book/ca-multiversal-equality.md %} -[union-types]: {% link _overviews/scala3-book/types-union.md %} +[collections-classes]: {% link _zh-cn/overviews/scala3-book/collections-classes.md %} +[collections-methods]: {% link _zh-cn/overviews/scala3-book/collections-methods.md %} +[control]: {% link _zh-cn/overviews/scala3-book/control-structures.md %} +[equality]: {% link _zh-cn/overviews/scala3-book/ca-multiversal-equality.md %} +[error-handling]: {% link _zh-cn/overviews/scala3-book/fp-functional-error-handling.md %} +[extension-methods]: {% link _zh-cn/overviews/scala3-book/ca-extension-methods.md %} +[givens]: {% link _zh-cn/overviews/scala3-book/ca-given-using-clauses.md %} +[hofs]: {% link _zh-cn/overviews/scala3-book/fun-hofs.md %} +[imports]: {% link _zh-cn/overviews/scala3-book/packaging-imports.md %} +[modeling-intro]: {% link _zh-cn/overviews/scala3-book/domain-modeling-intro.md %} +[modeling-oop]: {% link _zh-cn/overviews/scala3-book/domain-modeling-oop.md %} +[opaque]: {% link _zh-cn/overviews/scala3-book/types-opaque-types.md %} +[tools]: {% link _zh-cn/overviews/scala3-book/scala-tools.md %} +[toplevel]: {% link _zh-cn/overviews/scala3-book/taste-toplevel-definitions.md %} +[type-classes]: {% link _zh-cn/overviews/scala3-book/ca-type-classes.md %} + +[concurrency]: {% link _zh-cn/overviews/scala3-book/concurrency.md %} +[contextual]: {% link _zh-cn/overviews/scala3-book/ca-contextual-abstractions-intro.md %} +[control]: {% link _zh-cn/overviews/scala3-book/control-structures.md %} +[fp-intro]: {% link _zh-cn/overviews/scala3-book/fp-intro.md %} +[intersection-types]: {% link _zh-cn/overviews/scala3-book/types-intersection.md %} +[modeling-fp]: {% link _zh-cn/overviews/scala3-book/domain-modeling-fp.md %} +[multiversal]: {% link _zh-cn/overviews/scala3-book/ca-multiversal-equality.md %} +[union-types]: {% link _zh-cn/overviews/scala3-book/types-union.md %} diff --git a/_zh-cn/overviews/scala3-book/scala-for-javascript-devs.md b/_zh-cn/overviews/scala3-book/scala-for-javascript-devs.md index 13cb85cec2..3e80ad15e9 100644 --- a/_zh-cn/overviews/scala3-book/scala-for-javascript-devs.md +++ b/_zh-cn/overviews/scala3-book/scala-for-javascript-devs.md @@ -5,6 +5,11 @@ description: This chapter provides an introduction to Scala 3 for JavaScript dev num: 74 previous-page: scala-for-java-devs next-page: scala-for-python-devs + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -1313,18 +1318,18 @@ Scala 中还有其他一些概念目前在 JavaScript 中没有等效的概念 - 更多的 ... -[collections-classes]: {% link _overviews/scala3-book/collections-classes.md %} -[concurrency]: {% link _overviews/scala3-book/concurrency.md %} -[contextual]: {% link _overviews/scala3-book/ca-contextual-abstractions-intro.md %} -[control]: {% link _overviews/scala3-book/control-structures.md %} -[extension-methods]: {% link _overviews/scala3-book/ca-extension-methods.md %} -[fp-intro]: {% link _overviews/scala3-book/fp-intro.md %} -[givens]: {% link _overviews/scala3-book/ca-given-using-clauses.md %} -[hofs]: {% link _overviews/scala3-book/fun-hofs.md %} -[intersection-types]: {% link _overviews/scala3-book/types-intersection.md %} -[modeling-fp]: {% link _overviews/scala3-book/domain-modeling-fp.md %} -[modeling-oop]: {% link _overviews/scala3-book/domain-modeling-oop.md %} -[multiversal]: {% link _overviews/scala3-book/ca-multiversal-equality.md %} -[union-types]: {% link _overviews/scala3-book/types-union.md %} +[collections-classes]: {% link _zh-cn/overviews/scala3-book/collections-classes.md %} +[concurrency]: {% link _zh-cn/overviews/scala3-book/concurrency.md %} +[contextual]: {% link _zh-cn/overviews/scala3-book/ca-contextual-abstractions-intro.md %} +[control]: {% link _zh-cn/overviews/scala3-book/control-structures.md %} +[extension-methods]: {% link _zh-cn/overviews/scala3-book/ca-extension-methods.md %} +[fp-intro]: {% link _zh-cn/overviews/scala3-book/fp-intro.md %} +[givens]: {% link _zh-cn/overviews/scala3-book/ca-given-using-clauses.md %} +[hofs]: {% link _zh-cn/overviews/scala3-book/fun-hofs.md %} +[intersection-types]: {% link _zh-cn/overviews/scala3-book/types-intersection.md %} +[modeling-fp]: {% link _zh-cn/overviews/scala3-book/domain-modeling-fp.md %} +[modeling-oop]: {% link _zh-cn/overviews/scala3-book/domain-modeling-oop.md %} +[multiversal]: {% link _zh-cn/overviews/scala3-book/ca-multiversal-equality.md %} +[union-types]: {% link _zh-cn/overviews/scala3-book/types-union.md %} diff --git a/_zh-cn/overviews/scala3-book/scala-for-python-devs.md b/_zh-cn/overviews/scala3-book/scala-for-python-devs.md index 30b39a06ef..f3e17233f1 100644 --- a/_zh-cn/overviews/scala3-book/scala-for-python-devs.md +++ b/_zh-cn/overviews/scala3-book/scala-for-python-devs.md @@ -5,6 +5,11 @@ description: This page is for Python developers who are interested in learning a num: 75 previous-page: scala-for-javascript-devs next-page: + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- {% include_relative scala4x.css %} @@ -1337,18 +1342,18 @@ pip install -r requirements.txt 在 Scala 中,这些手动过程都不是必需的。 -[collections-classes]: {% link _overviews/scala3-book/collections-classes.md %} -[concurrency]: {% link _overviews/scala3-book/concurrency.md %} -[contextual]: {% link _overviews/scala3-book/ca-contextual-abstractions-intro.md %} -[control-structures]: {% link _overviews/scala3-book/control-structures.md %} -[extension-methods]: {% link _overviews/scala3-book/ca-extension-methods.md %} -[fp-intro]: {% link _overviews/scala3-book/fp-intro.md %} -[hofs]: {% link _overviews/scala3-book/fun-hofs.md %} -[intersection-types]: {% link _overviews/scala3-book/types-intersection.md %} -[main-method]: {% link _overviews/scala3-book/methods-main-methods.md %} -[modeling-intro]: {% link _overviews/scala3-book/domain-modeling-intro.md %} -[multiversal]: {% link _overviews/scala3-book/ca-multiversal-equality.md %} -[toplevel]: {% link _overviews/scala3-book/taste-toplevel-definitions.md %} -[type-classes]: {% link _overviews/scala3-book/types-type-classes.md %} -[union-types]: {% link _overviews/scala3-book/types-union.md %} +[collections-classes]: {% link _zh-cn/overviews/scala3-book/collections-classes.md %} +[concurrency]: {% link _zh-cn/overviews/scala3-book/concurrency.md %} +[contextual]: {% link _zh-cn/overviews/scala3-book/ca-contextual-abstractions-intro.md %} +[control-structures]: {% link _zh-cn/overviews/scala3-book/control-structures.md %} +[extension-methods]: {% link _zh-cn/overviews/scala3-book/ca-extension-methods.md %} +[fp-intro]: {% link _zh-cn/overviews/scala3-book/fp-intro.md %} +[hofs]: {% link _zh-cn/overviews/scala3-book/fun-hofs.md %} +[intersection-types]: {% link _zh-cn/overviews/scala3-book/types-intersection.md %} +[main-method]: {% link _zh-cn/overviews/scala3-book/methods-main-methods.md %} +[modeling-intro]: {% link _zh-cn/overviews/scala3-book/domain-modeling-intro.md %} +[multiversal]: {% link _zh-cn/overviews/scala3-book/ca-multiversal-equality.md %} +[toplevel]: {% link _zh-cn/overviews/scala3-book/taste-toplevel-definitions.md %} +[type-classes]: {% link _zh-cn/overviews/scala3-book/types-type-classes.md %} +[union-types]: {% link _zh-cn/overviews/scala3-book/types-union.md %} diff --git a/_zh-cn/overviews/scala3-book/scala-tools.md b/_zh-cn/overviews/scala3-book/scala-tools.md index 48e5522c7c..0362ffcc0e 100644 --- a/_zh-cn/overviews/scala3-book/scala-tools.md +++ b/_zh-cn/overviews/scala3-book/scala-tools.md @@ -5,6 +5,11 @@ description: This chapter looks at two commonly-used Scala tools, sbt and ScalaT num: 69 previous-page: concurrency next-page: tools-sbt + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/taste-collections.md b/_zh-cn/overviews/scala3-book/taste-collections.md index 5e79cb4a15..bd5f02cb01 100644 --- a/_zh-cn/overviews/scala3-book/taste-collections.md +++ b/_zh-cn/overviews/scala3-book/taste-collections.md @@ -5,6 +5,11 @@ description: This page provides a high-level overview of the main features of th num: 13 previous-page: taste-objects next-page: taste-contextual-abstractions + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -103,6 +108,6 @@ val (num, str, person) = t 有些情况更适合使用元组, 那就是当你想要将异构类型的集合放在一个小的类似集合的结构中。 有关更多元组详细信息,请参阅 [参考文档][reference]。 -[collections]: {% link _overviews/scala3-book/collections-intro.md %} +[collections]: {% link _zh-cn/overviews/scala3-book/collections-intro.md %} [api]: https://scala-lang.org/api/3.x/ [reference]: {{ site.scala3ref }}/overview.html diff --git a/_zh-cn/overviews/scala3-book/taste-contextual-abstractions.md b/_zh-cn/overviews/scala3-book/taste-contextual-abstractions.md index f845a0b8d4..b354a6a9f5 100644 --- a/_zh-cn/overviews/scala3-book/taste-contextual-abstractions.md +++ b/_zh-cn/overviews/scala3-book/taste-contextual-abstractions.md @@ -5,6 +5,11 @@ description: This section provides an introduction to Contextual Abstractions in num: 14 previous-page: taste-collections next-page: taste-toplevel-definitions + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -50,5 +55,5 @@ _上下文抽象_ 用于避免重复代码。 有关更多详细信息,请参阅本书的[上下文抽象章节][contextual],以及[参考文档][reference]。 -[contextual]: {% link _overviews/scala3-book/ca-contextual-abstractions-intro.md %} +[contextual]: {% link _zh-cn/overviews/scala3-book/ca-contextual-abstractions-intro.md %} [reference]: {{ site.scala3ref }}/overview.html diff --git a/_zh-cn/overviews/scala3-book/taste-control-structures.md b/_zh-cn/overviews/scala3-book/taste-control-structures.md index ace393cf6a..5efa015ee3 100644 --- a/_zh-cn/overviews/scala3-book/taste-control-structures.md +++ b/_zh-cn/overviews/scala3-book/taste-control-structures.md @@ -5,6 +5,11 @@ description: This section demonstrates Scala 3 control structures. num: 8 previous-page: taste-vars-data-types next-page: taste-modeling + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -266,4 +271,4 @@ do 由于传名参数、中缀表示法、流畅接口、可选括号、扩展方法和高阶函数等功能,您还可以创建自己的代码,就像控制结构一样工作。 您将在 [控制结构][control] 部分了解更多信息。 -[control]: {% link _overviews/scala3-book/control-structures.md %} +[control]: {% link _zh-cn/overviews/scala3-book/control-structures.md %} diff --git a/_zh-cn/overviews/scala3-book/taste-functions.md b/_zh-cn/overviews/scala3-book/taste-functions.md index b458e09a59..6947dfcb69 100644 --- a/_zh-cn/overviews/scala3-book/taste-functions.md +++ b/_zh-cn/overviews/scala3-book/taste-functions.md @@ -5,6 +5,11 @@ description: This page provides an introduction to functions in Scala 3. num: 11 previous-page: taste-methods next-page: taste-objects + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -59,4 +64,4 @@ val x = nums.filter(_ > 3) 除了在整个标准库中使用的高阶函数外,您还可以[创建自己的][higher-order] 高阶函数。 -[higher-order]: {% link _overviews/scala3-book/fun-hofs.md %} +[higher-order]: {% link _zh-cn/overviews/scala3-book/fun-hofs.md %} diff --git a/_zh-cn/overviews/scala3-book/taste-hello-world.md b/_zh-cn/overviews/scala3-book/taste-hello-world.md index 577699528c..6f2b5003b3 100644 --- a/_zh-cn/overviews/scala3-book/taste-hello-world.md +++ b/_zh-cn/overviews/scala3-book/taste-hello-world.md @@ -5,6 +5,11 @@ description: This section demonstrates a Scala 3 'Hello, World!' example. num: 5 previous-page: taste-intro next-page: taste-repl + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -50,4 +55,4 @@ Hello, world! > 在 [Scala 工具][scala_tools] 章节中可以找到 sbt 和其他使 Scala 开发更容易的工具相关的更多信息。 -[scala_tools]: {% link _overviews/scala3-book/scala-tools.md %} \ No newline at end of file +[scala_tools]: {% link _zh-cn/overviews/scala3-book/scala-tools.md %} \ No newline at end of file diff --git a/_zh-cn/overviews/scala3-book/taste-intro.md b/_zh-cn/overviews/scala3-book/taste-intro.md index fc4294c0f7..1aa0b92bcb 100644 --- a/_zh-cn/overviews/scala3-book/taste-intro.md +++ b/_zh-cn/overviews/scala3-book/taste-intro.md @@ -5,6 +5,11 @@ description: This chapter provides a high-level overview of the main features of num: 4 previous-page: why-scala-3 next-page: taste-hello-world + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/taste-methods.md b/_zh-cn/overviews/scala3-book/taste-methods.md index 9404f4366b..fb1da65c2f 100644 --- a/_zh-cn/overviews/scala3-book/taste-methods.md +++ b/_zh-cn/overviews/scala3-book/taste-methods.md @@ -5,6 +5,11 @@ description: This section provides an introduction to defining and using methods num: 10 previous-page: taste-modeling next-page: taste-functions + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -126,4 +131,4 @@ extension (s: String) Scala方法可以更强大:它们可以采用类型参数和上下文参数。 它们在[领域建模][data-1]一节中有详细介绍。 -[data-1]: {% link _overviews/scala3-book/domain-modeling-tools.md %} +[data-1]: {% link _zh-cn/overviews/scala3-book/domain-modeling-tools.md %} diff --git a/_zh-cn/overviews/scala3-book/taste-modeling.md b/_zh-cn/overviews/scala3-book/taste-modeling.md index 34e9c9bce8..2ade36d68d 100644 --- a/_zh-cn/overviews/scala3-book/taste-modeling.md +++ b/_zh-cn/overviews/scala3-book/taste-modeling.md @@ -5,6 +5,11 @@ description: This section provides an introduction to data modeling in Scala 3. num: 9 previous-page: taste-control-structures next-page: taste-methods + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -212,4 +217,4 @@ p2 // : Person = Person(Elton John,Singer) 有关 `case` 类的更多详细信息,请参阅 [领域建模][data-1] 部分。 -[data-1]: {% link _overviews/scala3-book/domain-modeling-tools.md %} +[data-1]: {% link _zh-cn/overviews/scala3-book/domain-modeling-tools.md %} diff --git a/_zh-cn/overviews/scala3-book/taste-objects.md b/_zh-cn/overviews/scala3-book/taste-objects.md index 076eda4a4c..10b5e80d47 100644 --- a/_zh-cn/overviews/scala3-book/taste-objects.md +++ b/_zh-cn/overviews/scala3-book/taste-objects.md @@ -5,6 +5,11 @@ description: This section provides an introduction to the use of singleton objec num: 12 previous-page: taste-functions next-page: taste-collections + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/taste-repl.md b/_zh-cn/overviews/scala3-book/taste-repl.md index 1f4c892027..e77217c81a 100644 --- a/_zh-cn/overviews/scala3-book/taste-repl.md +++ b/_zh-cn/overviews/scala3-book/taste-repl.md @@ -5,6 +5,11 @@ description: This section provides an introduction to the Scala REPL. num: 6 previous-page: taste-hello-world next-page: taste-vars-data-types + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -56,4 +61,4 @@ val res2: Int = 4 如果您更喜欢在文本编辑器中而不是在控制台提示符中编写代码,您可以使用 [worksheet]。 -[worksheet]: {% link _overviews/scala3-book/tools-worksheets.md %} +[worksheet]: {% link _zh-cn/overviews/scala3-book/tools-worksheets.md %} diff --git a/_zh-cn/overviews/scala3-book/taste-summary.md b/_zh-cn/overviews/scala3-book/taste-summary.md index 3b6f74d6b7..dd320bea58 100644 --- a/_zh-cn/overviews/scala3-book/taste-summary.md +++ b/_zh-cn/overviews/scala3-book/taste-summary.md @@ -5,6 +5,11 @@ description: This page provides a summary of the previous 'Taste of Scala' secti num: 16 previous-page: taste-toplevel-definitions next-page: first-look-at-types + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -26,4 +31,4 @@ Scala还有更多功能在这次旋风之旅中没有涵盖。 有关更多详细信息,请参阅本书的其余部分和[参考文档][reference]。 [reference]: {{ site.scala3ref }}/overview.html -[contextual]: {% link _overviews/scala3-book/ca-contextual-abstractions-intro.md %} +[contextual]: {% link _zh-cn/overviews/scala3-book/ca-contextual-abstractions-intro.md %} diff --git a/_zh-cn/overviews/scala3-book/taste-toplevel-definitions.md b/_zh-cn/overviews/scala3-book/taste-toplevel-definitions.md index 7e848d6caf..e36a35adc6 100644 --- a/_zh-cn/overviews/scala3-book/taste-toplevel-definitions.md +++ b/_zh-cn/overviews/scala3-book/taste-toplevel-definitions.md @@ -5,6 +5,11 @@ description: This page provides an introduction to top-level definitions in Scal num: 15 previous-page: taste-contextual-abstractions next-page: taste-summary + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/taste-vars-data-types.md b/_zh-cn/overviews/scala3-book/taste-vars-data-types.md index c19549248d..39945b132a 100644 --- a/_zh-cn/overviews/scala3-book/taste-vars-data-types.md +++ b/_zh-cn/overviews/scala3-book/taste-vars-data-types.md @@ -5,6 +5,11 @@ description: This section demonstrates val and var variables, and some common Sc num: 7 previous-page: taste-repl next-page: taste-control-structures + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -195,4 +200,4 @@ val quote = """The essence of Scala: > 有关字符串插值器和多行字符串的更多详细信息,请参阅[“First Look at Types”章节][first-look]。 -[first-look]: {% link _overviews/scala3-book/first-look-at-types.md %} +[first-look]: {% link _zh-cn/overviews/scala3-book/first-look-at-types.md %} diff --git a/_zh-cn/overviews/scala3-book/tools-sbt.md b/_zh-cn/overviews/scala3-book/tools-sbt.md index 23edcbfb0f..7e19cb629f 100644 --- a/_zh-cn/overviews/scala3-book/tools-sbt.md +++ b/_zh-cn/overviews/scala3-book/tools-sbt.md @@ -5,6 +5,11 @@ description: This section looks at a commonly-used build tool, sbt, and a testin num: 70 previous-page: scala-tools next-page: tools-worksheets + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/tools-worksheets.md b/_zh-cn/overviews/scala3-book/tools-worksheets.md index 2385e80f4d..811bc2763e 100644 --- a/_zh-cn/overviews/scala3-book/tools-worksheets.md +++ b/_zh-cn/overviews/scala3-book/tools-worksheets.md @@ -5,6 +5,11 @@ description: This section looks at worksheets, an alternative to Scala projects. num: 71 previous-page: tools-sbt next-page: interacting-with-java + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -55,5 +60,5 @@ next-page: interacting-with-java 从上到下进行评估。 -[REPL session]: {% link _overviews/scala3-book/taste-repl.md %} -[program entry point]: {% link _overviews/scala3-book/methods-main-methods.md %} +[REPL session]: {% link _zh-cn/overviews/scala3-book/taste-repl.md %} +[program entry point]: {% link _zh-cn/overviews/scala3-book/methods-main-methods.md %} diff --git a/_zh-cn/overviews/scala3-book/types-adts-gadts.md b/_zh-cn/overviews/scala3-book/types-adts-gadts.md index 5c504d0165..367e77394d 100644 --- a/_zh-cn/overviews/scala3-book/types-adts-gadts.md +++ b/_zh-cn/overviews/scala3-book/types-adts-gadts.md @@ -5,6 +5,11 @@ description: This section introduces and demonstrates algebraic data types (ADTs num: 52 previous-page: types-union next-page: types-variance + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/types-dependent-function.md b/_zh-cn/overviews/scala3-book/types-dependent-function.md index 20550ffabd..1b9c29ebcf 100644 --- a/_zh-cn/overviews/scala3-book/types-dependent-function.md +++ b/_zh-cn/overviews/scala3-book/types-dependent-function.md @@ -5,6 +5,11 @@ description: This section introduces and demonstrates dependent function types i num: 56 previous-page: types-structural next-page: types-others + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/types-generics.md b/_zh-cn/overviews/scala3-book/types-generics.md index d9b03e1ac0..484327c62c 100644 --- a/_zh-cn/overviews/scala3-book/types-generics.md +++ b/_zh-cn/overviews/scala3-book/types-generics.md @@ -5,6 +5,11 @@ description: This section introduces and demonstrates generics in Scala 3. num: 49 previous-page: types-inferred next-page: types-intersection + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -43,4 +48,4 @@ println(stack.pop()) // prints 1 > 有关如何用泛型类型表达可变的详细信息,请参阅[型变(Variance)部分][variance]。 -[variance]: {% link _overviews/scala3-book/types-variance.md %} +[variance]: {% link _zh-cn/overviews/scala3-book/types-variance.md %} diff --git a/_zh-cn/overviews/scala3-book/types-inferred.md b/_zh-cn/overviews/scala3-book/types-inferred.md index d20c704133..8954a93cc4 100644 --- a/_zh-cn/overviews/scala3-book/types-inferred.md +++ b/_zh-cn/overviews/scala3-book/types-inferred.md @@ -5,6 +5,11 @@ description: This section introduces and demonstrates inferred types in Scala 3 num: 48 previous-page: types-introduction next-page: types-generics + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/types-intersection.md b/_zh-cn/overviews/scala3-book/types-intersection.md index 60d4788b2f..711ad81a01 100644 --- a/_zh-cn/overviews/scala3-book/types-intersection.md +++ b/_zh-cn/overviews/scala3-book/types-intersection.md @@ -5,6 +5,11 @@ description: This section introduces and demonstrates intersection types in Scal num: 50 previous-page: types-generics next-page: types-union + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/types-introduction.md b/_zh-cn/overviews/scala3-book/types-introduction.md index ee8eeba7ea..6a425da596 100644 --- a/_zh-cn/overviews/scala3-book/types-introduction.md +++ b/_zh-cn/overviews/scala3-book/types-introduction.md @@ -5,6 +5,11 @@ description: This chapter provides an introduction to Scala 3 types and the type num: 47 previous-page: fp-summary next-page: types-inferred + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -44,4 +49,4 @@ def dogCatOrWhatever(): Dog | Plant | Car | Sun = ??? 鉴于此简要介绍,以下部分将概述 Scala 类型系统的特性。 -[union-types]: {% link _overviews/scala3-book/types-union.md %} +[union-types]: {% link _zh-cn/overviews/scala3-book/types-union.md %} diff --git a/_zh-cn/overviews/scala3-book/types-opaque-types.md b/_zh-cn/overviews/scala3-book/types-opaque-types.md index d75e4c22ca..eab037e2c3 100644 --- a/_zh-cn/overviews/scala3-book/types-opaque-types.md +++ b/_zh-cn/overviews/scala3-book/types-opaque-types.md @@ -5,6 +5,11 @@ description: This section introduces and demonstrates opaque types in Scala 3. num: 54 previous-page: types-variance next-page: types-structural + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- @@ -151,4 +156,4 @@ val d: Double = l2 // ERROR: Found Logarithm required Double 不透明类型提供了对实现细节的合理抽象,而不会增加性能开销。 如上图所示,不透明类型使用起来很方便,并且与 [扩展方法][extension] 功能很好地集成在一起。 -[extension]: {% link _overviews/scala3-book/ca-extension-methods.md %} +[extension]: {% link _zh-cn/overviews/scala3-book/ca-extension-methods.md %} diff --git a/_zh-cn/overviews/scala3-book/types-others.md b/_zh-cn/overviews/scala3-book/types-others.md index 220fd7eec2..8861090281 100644 --- a/_zh-cn/overviews/scala3-book/types-others.md +++ b/_zh-cn/overviews/scala3-book/types-others.md @@ -5,6 +5,11 @@ description: This section mentions other advanced types in Scala 3. num: 57 previous-page: types-dependent-function next-page: ca-contextual-abstractions-intro + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/types-structural.md b/_zh-cn/overviews/scala3-book/types-structural.md index 662aa57cd9..3ea74afdda 100644 --- a/_zh-cn/overviews/scala3-book/types-structural.md +++ b/_zh-cn/overviews/scala3-book/types-structural.md @@ -5,6 +5,11 @@ description: This section introduces and demonstrates structural types in Scala num: 55 previous-page: types-opaque-types next-page: types-dependent-function + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/types-type-classes.md b/_zh-cn/overviews/scala3-book/types-type-classes.md index f0391f3806..331b83f2ab 100644 --- a/_zh-cn/overviews/scala3-book/types-type-classes.md +++ b/_zh-cn/overviews/scala3-book/types-type-classes.md @@ -5,6 +5,11 @@ description: This section introduces type classes in Scala 3. num: 60 previous-page: ca-given-using-clauses next-page: ca-context-bounds + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- A _type class_ is an abstract, parameterized type that lets you add new behavior to any closed data type without using sub-typing. @@ -48,5 +53,5 @@ Since type classes are a very important way to structure software, Scala 3 offer We discuss these additional features (which fall into the category of *Contextual Abstractions*) in a [later chapter][typeclasses-chapter] of this book. [typeclasses-paper]: https://infoscience.epfl.ch/record/150280/files/TypeClasses.pdf -[typeclasses-chapter]: {% link _overviews/scala3-book/ca-type-classes.md %} +[typeclasses-chapter]: {% link _zh-cn/overviews/scala3-book/ca-type-classes.md %} [comparator]: https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html diff --git a/_zh-cn/overviews/scala3-book/types-union.md b/_zh-cn/overviews/scala3-book/types-union.md index 18a8a5f8a5..826fc63acd 100644 --- a/_zh-cn/overviews/scala3-book/types-union.md +++ b/_zh-cn/overviews/scala3-book/types-union.md @@ -5,6 +5,11 @@ description: This section introduces and demonstrates union types in Scala 3. num: 51 previous-page: types-intersection next-page: types-adts-gadts + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/types-variance.md b/_zh-cn/overviews/scala3-book/types-variance.md index aef80cb9cc..9b6274d6ec 100644 --- a/_zh-cn/overviews/scala3-book/types-variance.md +++ b/_zh-cn/overviews/scala3-book/types-variance.md @@ -5,6 +5,11 @@ description: This section introduces and demonstrates variance in Scala 3. num: 53 previous-page: types-adts-gadts next-page: types-opaque-types + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- diff --git a/_zh-cn/overviews/scala3-book/where-next.md b/_zh-cn/overviews/scala3-book/where-next.md new file mode 100644 index 0000000000..3cd5a6e729 --- /dev/null +++ b/_zh-cn/overviews/scala3-book/where-next.md @@ -0,0 +1,19 @@ +--- +title: 下一步去哪 +type: chapter +description: Where to go next after reading the Scala Book +num: 76 +previous-page: scala-for-python-devs +next-page: + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" +--- + +我们希望你能喜欢 Scala 编程语言的介绍,我们也希望你能分享一些这门语言的美丽之处。 + +如果你继续用 Scala 工作,你可以在我们[引导和概览部分][overviews]发现更多细节。 + +[overviews]: {% link _overviews/index.md %} diff --git a/_zh-cn/overviews/scala3-book/why-scala-3.md b/_zh-cn/overviews/scala3-book/why-scala-3.md index 00d7dac8b8..738478e232 100644 --- a/_zh-cn/overviews/scala3-book/why-scala-3.md +++ b/_zh-cn/overviews/scala3-book/why-scala-3.md @@ -5,6 +5,11 @@ description: This page describes the benefits of the Scala 3 programming languag num: 3 previous-page: scala-features next-page: taste-intro + +partof: scala3-book +overview-name: "Scala 3 — Book" +layout: multipage-overview +permalink: "/zh-cn/scala3/book/:title.html" --- {% comment %} @@ -142,7 +147,7 @@ list.map(_ * 2) Scala 2 中的隐式是一个主要明显的设计特征。 它们代表了抽象上下文的基本方式,具有服务于各种用例的统一范式,其中包括: -- 实现 [type classes]({% link _overviews/scala3-book/ca-type-classes.md %}) +- 实现 [type classes]({% link _zh-cn/overviews/scala3-book/ca-type-classes.md %}) - 建立背景 - 依赖注入 - 表达能力 @@ -265,7 +270,7 @@ val b = List(1,2,3) // List 是不可变的 val c = Map(1 -> "one") // Map 是不可变的 ``` -样例类主要用于 [领域建模]({% link _overviews/scala3-book/domain-modeling-intro.md %}),它们的参数是不可变的: +样例类主要用于 [领域建模]({% link _zh-cn/overviews/scala3-book/domain-modeling-intro.md %}),它们的参数是不可变的: ```scala case class Person(name: String) @@ -399,13 +404,13 @@ _性能_ 涉及几个方面。 Scala 有许多很棒的特性,选择十大列表可能是主观的。 多项调查表明,不同的开发人员群体喜欢不同的特性。 -[java]: {% link _overviews/scala3-book/interacting-with-java.md %} -[given]: {% link _overviews/scala3-book/ca-given-using-clauses.md %} -[contextual]: {% link _overviews/scala3-book/ca-contextual-abstractions-intro.md %} +[java]: {% link _zh-cn/overviews/scala3-book/interacting-with-java.md %} +[given]: {% link _zh-cn/overviews/scala3-book/ca-given-using-clauses.md %} +[contextual]: {% link _zh-cn/overviews/scala3-book/ca-contextual-abstractions-intro.md %} [reference]: {{ site.scala3ref }} [dropped]: {{ site.scala3ref }}/dropped-features [changed]: {{ site.scala3ref }}/changed-features [added]:{{ site.scala3ref }}/other-new-features -[union-types]: {% link _overviews/scala3-book/types-union.md %} -[opaque-types]: {% link _overviews/scala3-book/types-opaque-types.md %} +[union-types]: {% link _zh-cn/overviews/scala3-book/types-union.md %} +[opaque-types]: {% link _zh-cn/overviews/scala3-book/types-opaque-types.md %}