diff --git a/_config.yml b/_config.yml index 034b324714..6b5d64a1b5 100644 --- a/_config.yml +++ b/_config.yml @@ -96,6 +96,42 @@ defaults: type: "tour" values: overview-name: "Tour of Scala" + - + scope: + path: "_overviews/macros" + values: + scala2: true + versionSpecific: true + - + scope: + path: "_overviews/reflection" + values: + scala2: true + versionSpecific: true + - + scope: + path: "_overviews/quasiquotes" + values: + scala2: true + versionSpecific: true + - + scope: + path: "_overviews/repl" + values: + scala2: true + versionSpecific: true + - + scope: + path: "_overviews/plugins" + values: + scala2: true + versionSpecific: true + - + scope: + path: "_overviews/compiler-options" + values: + scala2: true + versionSpecific: true - scope: path: "_overviews/scala3-book" @@ -141,6 +177,7 @@ defaults: path: "_overviews/scala3-macros" values: scala3: true + versionSpecific: true partof: scala3-macros overview-name: "Macros in Scala 3" layout: multipage-overview @@ -150,6 +187,7 @@ defaults: path: "_overviews/scala3-scaladoc" values: scala3: true + versionSpecific: true partof: scala3-scaladoc overview-name: "Scaladoc" layout: multipage-overview diff --git a/_data/doc-nav-header.yml b/_data/doc-nav-header.yml index 52b66be1da..392012e3b5 100644 --- a/_data/doc-nav-header.yml +++ b/_data/doc-nav-header.yml @@ -1,11 +1,24 @@ - title: Getting Started url: "/getting-started/index.html" +- title: Scala 3 + url: "#" + submenu: + - title: What's New? + url: "/scala3/new-in-scala3.html" + - title: Migrating From Scala 2 + url: "/scala3/guides/migration/compatibility-intro.html" + - title: New Features for Scaladoc + url: "/scala3/scaladoc.html" + - title: Videos and Talks + url: "/scala3/talks.html" - title: Learn url: "#" submenu: - title: Tour of Scala url: "/tour/tour-of-scala.html" - - title: Scala Book + - title: Scala 3 Book + url: "/scala3/book/introduction.html" + - title: Scala 2 Book url: "/overviews/scala-book/introduction.html" - title: Online Courses url: "/online-courses.html" @@ -33,10 +46,14 @@ url: "/books.html" - title: Scala FAQ url: "/tutorials/FAQ/index.html" - - title: Language Specification + - title: Scala Language Specification url: http://scala-lang.org/files/archive/spec/2.13/ - - title: Contribution Guide + - title: Scala 3 Language Reference + url: "https://docs.scala-lang.org/scala3/reference" + - title: Scala Contribution Guide url: "/contribute/" + - title: Scala 3 Compiler Contributing Guide + url: "/scala3/guides/contribution/contribution-intro.html" - title: Style Guide url: "/style/index.html" - title: Cheatsheet @@ -44,11 +61,6 @@ - title: Glossary url: "/glossary/index.html" - title: API - url: "#" - submenu: - - title: Current - url: https://www.scala-lang.org/api/current/ - - title: All Versions - url: "/api/all.html" + url: "/api/all.html" - title: SIPs url: "/sips/index.html" diff --git a/_data/overviews.yml b/_data/overviews.yml index a8bc055f7c..fb6f7a904a 100644 --- a/_data/overviews.yml +++ b/_data/overviews.yml @@ -1,4 +1,3 @@ - - category: Standard Library description: "Guides and overviews covering the Scala standard library." overviews: @@ -60,6 +59,31 @@ - category: Language description: "Guides and overviews covering features in the Scala language." overviews: + - title: "Migration from Scala 2 to Scala 3" + by: Adrien Piquerez + icon: suitcase + root: "scala3/guides/" + url: "migration/compatibility-intro.html" + description: "Everything you need to know about compatibility and migration to Scala 3." + - title: Scala 3 Macros + by: Nicolas Stucki + icon: magic + root: "scala3/guides/" + url: "macros" + description: "A detailed tutorial to cover all the features involved in writing macros in Scala 3." + label-text: new in Scala 3 + - title: Value Classes and Universal Traits + by: Mark Harrah + description: "Value classes are a new mechanism in Scala to avoid allocating runtime objects. This is accomplished through the definition of new AnyVal subclasses." + icon: gem + url: "core/value-classes.html" + - title: An Overview of TASTy + by: Alvin Alexander + icon: birthday-cake + label-text: new in Scala 3 + root: "scala3/guides/" + url: "tasty-overview.html" + description: "An overview over the TASTy format aimed at end-users of the Scala language." - title: String Interpolation icon: dollar-sign url: "core/string-interpolation.html" @@ -72,11 +96,15 @@ by: Josh Suereth description: "Scala 2.10 introduced a new feature called implicit classes. An implicit class is a class marked with the implicit keyword. This keyword makes the class’ primary constructor available for implicit conversions when the class is in scope." url: "core/implicit-classes.html" - - title: Value Classes and Universal Traits - by: Mark Harrah - description: "Value classes are a new mechanism in Scala to avoid allocating runtime objects. This is accomplished through the definition of new AnyVal subclasses." - icon: gem - url: "core/value-classes.html" + - title: The Scala Book + by: Alvin Alexander + icon: book + label-color: "#899295" + label-text: archived + url: "scala-book/introduction.html" + description: > + A light introduction to the Scala language, focused on Scala 2. + Now updated for Scala 3, we are in the process of merging the two. - category: Authoring Libraries description: "Guides for contributing open source libraries to the Scala ecosystem." @@ -137,13 +165,20 @@ - category: "Tools" description: "Reference material on core Scala tools like the Scala REPL and Scaladoc generation." overviews: - - title: Scala REPL + - title: Scala 2 REPL icon: terminal url: "repl/overview.html" description: | The Scala REPL is a tool (scala) for evaluating expressions in Scala.

The scala command will execute a source script by wrapping it in a template and then compiling and executing the resulting program + - title: Scaladoc For Scala 3 + by: Krzysztof Romanowski, Aleksander Boruch-Gruszecki, Andrzej Ratajczak, Kacper Korban, Filip Zybała + icon: book + root: "scala3/guides/" + url: "scaladoc" + description: "Updates in Scala 3 to Scala’s API documentation generation tool." + label-text: updated - title: Scaladoc url: "scaladoc/overview.html" icon: book @@ -159,12 +194,18 @@ - category: Compiler description: "Guides and overviews covering the Scala compiler: compiler plugins, reflection, and metaprogramming tools such as macros." overviews: - - title: Reflection + - title: "Scala 3 Contributing Guide" + by: Jamie Thompson, Anatolii Kmetiuk + icon: cogs + root: "scala3/guides/" + url: "contribution/contribution-intro.html" + description: "Guide to the Scala 3 Compiler and fixing an issue" + - title: Scala 2 Reflection by: Heather Miller, Eugene Burmako, and Philipp Haller icon: binoculars url: "reflection/overview.html" description: Scala's runtime/compile-time reflection framework. - label-text: experimental + label-text: removed in Scala 3 subdocs: - title: Overview url: "reflection/overview.html" @@ -180,12 +221,12 @@ url: "reflection/thread-safety.html" - title: Changes in Scala 2.11 url: "reflection/changelog211.html" - - title: Macros + - title: Scala 2 Macros by: Eugene Burmako icon: magic url: "macros/usecases.html" description: "Scala's metaprogramming framework." - label-text: experimental + label-text: removed in Scala 3 subdocs: - title: Use Cases url: "macros/usecases.html" @@ -211,12 +252,12 @@ url: "macros/roadmap.html" - title: Changes in 2.11 url: "macros/changelog211.html" - - title: Quasiquotes + - title: Quasiquotes in Scala 2 by: Denys Shabalin icon: quote-left url: "quasiquotes/setup.html" description: "Quasiquotes are a convenient way to manipulate Scala syntax trees." - label-text: experimental + label-text: removed in Scala 3 subdocs: - title: Dependencies and setup url: "quasiquotes/setup.html" @@ -244,12 +285,12 @@ url: "quasiquotes/terminology.html" - title: Future prospects url: "quasiquotes/future.html" - - title: Compiler Plugins + - title: Scala 2 Compiler Plugins by: Lex Spoon and Seth Tisue icon: puzzle-piece url: "plugins/index.html" description: "Compiler plugins permit customizing and extending the Scala compiler. This tutorial describes the plugin facility and walks you through how to create a simple plugin." - - title: Compiler Options + - title: Scala 2 Compiler Options by: Community icon: cog url: "compiler-options/index.html" @@ -265,7 +306,6 @@ url: "compiler-options/optimizer.html" description: "The compiler can perform various optimizations." - - category: Legacy description: "Guides covering features no longer relevant to recent Scala versions (2.12+)." overviews: diff --git a/_data/scala3-doc-nav-header.yml b/_data/scala3-doc-nav-header.yml deleted file mode 100644 index 3493bd4de3..0000000000 --- a/_data/scala3-doc-nav-header.yml +++ /dev/null @@ -1,24 +0,0 @@ -- title: Getting Started - url: "/scala3/getting-started.html" -- title: Learn - url: "#" - submenu: - - title: New in Scala 3 - url: "/scala3/new-in-scala3.html" - - title: Scala 3 Book - url: "/scala3/book/introduction.html" - - title: Online Courses - url: "/online-courses.html" -- title: Migrate - url: "/scala3/guides/migration/compatibility-intro.html" -- title: Reference - url: '#' - submenu: - - title: Guides - url: '/scala3/guides.html' - - title: Language Specification - url: "https://docs.scala-lang.org/scala3/reference" - - title: Scala Library API - url: "https://scala-lang.org/api/3.x/" -- title: Contributing Guide - url: "/scala3/guides/contribution/contribution-intro.html" diff --git a/_getting-started/index.md b/_getting-started/index.md index a26af28495..5db17b403c 100644 --- a/_getting-started/index.md +++ b/_getting-started/index.md @@ -5,7 +5,9 @@ partof: getting-started languages: [fr, ja, uk] includeTOC: true -redirect_from: "/getting-started.html" +redirect_from: + - /getting-started.html + - /scala3/getting-started.html # we deleted the scala 3 version of this page --- {% include getting-started.md %} diff --git a/_includes/documentation-sections.html b/_includes/documentation-sections.html index 4ca75f459d..fd6714fc8b 100644 --- a/_includes/documentation-sections.html +++ b/_includes/documentation-sections.html @@ -14,15 +14,5 @@
{{link.title}}
{% endfor %} -
  - {% if section.more-resources %} - {{ page.more-resources-label }}: - - {% endif %} -
{% endfor %} diff --git a/_includes/headertop.html b/_includes/headertop.html index 1c68eeed39..fbb452e182 100644 --- a/_includes/headertop.html +++ b/_includes/headertop.html @@ -1,8 +1,15 @@ -{% if page.scala3 %} - +{% if page.scala3 or page.new-version %} + {% assign classes='' %} + {% if page.scala3 %} + {% assign classes= classes | append: ' scala3' %} + {% endif %} + {% if page.new-version %} + {% assign classes= classes | append: ' outdated-page' %} + {% endif %} + {% else %} - + {% endif %} diff --git a/_includes/navbar-inner.html b/_includes/navbar-inner.html index 171d00924e..8ce1227e62 100644 --- a/_includes/navbar-inner.html +++ b/_includes/navbar-inner.html @@ -1,8 +1,4 @@ -{% if page.scala3 %} - {% assign navdata = site.data.scala3-doc-nav-header %} -{% else %} - {% assign navdata = site.data.doc-nav-header %} -{% endif %} +{% assign navdata = site.data.doc-nav-header %} {% include site-header.html %} @@ -18,9 +14,6 @@ <a href="{{ site.baseurl }}/{{ docsRootTranslated.language }}"> <img src="{{ site.baseurl }}/resources/img/documentation-logo@2x.png" alt="docs"> </a> - <span class="doc-language-version"> - — Scala {% if page.scala3 %} 3 {% else %} 2 {% endif %} - </span> </div> <div class="navigation-ellipsis"> <i class="fa fa-ellipsis-v"></i> diff --git a/_includes/sidebar-toc-multipage-overview.html b/_includes/sidebar-toc-multipage-overview.html index 168f4b5950..e82f7bc8d5 100644 --- a/_includes/sidebar-toc-multipage-overview.html +++ b/_includes/sidebar-toc-multipage-overview.html @@ -1,13 +1,12 @@ +{% assign pagetype = page.type %} <div class="content-nav"> - <div class="inner-box sidebar-toc-wrapper" style=""> + <div class="inner-box sidebar-toc-wrapper {% if pagetype %}book{% endif %}" style=""> <h5 class="contents">Contents</h5> - {% assign type = page.type %} - {% if type %} - <div class="inner-toc book" id="sidebar-toc"> - {% else %} - <div class="inner-toc" id="sidebar-toc"> - {% endif %} - + {% if pagetype %} + <div class="inner-toc book" id="sidebar-toc"> + {% else %} + <div class="inner-toc" id="sidebar-toc"> + {% endif %} <ul> {% assign sorted = site[page.collection] | sort: 'num' %} {% for pg in sorted %} diff --git a/_includes/version-specific-notice.html b/_includes/version-specific-notice.html new file mode 100644 index 0000000000..b7a5a6f291 --- /dev/null +++ b/_includes/version-specific-notice.html @@ -0,0 +1,13 @@ +{% if include.language %} +<blockquote class="help-info"> + <i class="fa fa-info"></i><span style="margin-left: 0.5rem"> + {% if include.language == 'scala3' %} + This doc page is specific to Scala 3, + and may cover new concepts not available in Scala 2. + {% else if include.language == 'scala2' %} + This doc page is specific to features shipped in Scala 2, + which have either been removed in Scala 3 or replaced by an alternative. + {% endif %} + </span> +</blockquote> +{% endif %} diff --git a/_ja/getting-started/index.md b/_ja/getting-started/index.md index 3a20db86c6..e1d4101870 100644 --- a/_ja/getting-started/index.md +++ b/_ja/getting-started/index.md @@ -4,6 +4,8 @@ title: 入門 partof: getting-started language: ja includeTOC: true +redirect_from: + - /ja/scala3/getting-started.html # we deleted the scala 3 version of this page --- {% include _ja/getting-started.md %} diff --git a/_ja/scala3/getting-started.md b/_ja/scala3/getting-started.md deleted file mode 100644 index 120647c4c2..0000000000 --- a/_ja/scala3/getting-started.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -layout: singlepage-overview -title: Getting Started with Scala 3 -scala3: true -language: ja ---- - -{% include _ja/getting-started.md %} diff --git a/_layouts/inner-page-parent-dropdown.html b/_layouts/inner-page-parent-dropdown.html index 1bd7ae1f23..bd5b2c4e24 100644 --- a/_layouts/inner-page-parent-dropdown.html +++ b/_layouts/inner-page-parent-dropdown.html @@ -1,6 +1,5 @@ {% include headertop.html %} {% include headerbottom.html %} -{% if page.new-version %}<a class="new-version-notice" href="{{ page.new-version }}">This page has a new version.</a>{% endif %} @@ -13,17 +12,12 @@ <section class="title-page"> <div class="wrap"> <div class="content-title-documentation"> - {% if page.scala3 %} + {% if page.new-version %} <div class="wip-notice"> - <h4>Work in Progress</h4> - <p> - We are still in the process of writing the documentation for Scala 3. - You can <a href="/scala3/contribute-to-docs.html">help us</a> to improve the documentation. - </p> - <p>Are you searching for the <a href="/">Scala 2 documentation</a>?</p> + <h4>Outdated Notice</h4> + <p><a class="new-version-notice" href="{{ page.new-version }}"><i class="fa fa-info"></i><span>  This page has a new version.</span></a></p> </div> {% endif %} - <div class="titles"> {% if page.overview-name %} <div class="supertitle">{{ page.overview-name }}</div> diff --git a/_layouts/multipage-overview.html b/_layouts/multipage-overview.html index 17033116ae..5d384433e7 100644 --- a/_layouts/multipage-overview.html +++ b/_layouts/multipage-overview.html @@ -9,6 +9,14 @@ <div class="content-primary documentation"> <div class="inner-box"> <div class="toc-context"> + {% if page.versionSpecific %} + {% if page.scala3 %} + {% assign versionSpecificLang = 'scala3' %} + {% else if page.scala2 %} + {% assign versionSpecificLang = 'scala2' %} + {% endif %} + {% include version-specific-notice.html language=versionSpecificLang %} + {% endif %} {{content}} </div> diff --git a/_layouts/overviews.html b/_layouts/overviews.html index 2436cf1855..73b4afb478 100644 --- a/_layouts/overviews.html +++ b/_layouts/overviews.html @@ -44,6 +44,11 @@ <h2>{{ category.category }}</h2> {% if category.description %}<p>{{ category.description }}</p>{% endif %} <div class="card-group"> {% for overview in category.overviews %} + {% if overview.root %} + {% assign overviewroot = overview.root %} + {% else %} + {% assign overviewroot = 'overviews/' %} + {% endif %} <div class="white-card"> <div class="card-wrap"> <div class="card-header"> @@ -52,8 +57,8 @@ <h2>{{ category.category }}</h2> <div class="icon"><i class="fa fa-{{ overview.icon }}" aria-hidden="true"></i></div> </div> {% endif %} - {% capture originalOverviewUrl %}/overviews/{{ overview.url }}{% endcapture %} - {% capture translatedOverviewId %}/{{page.language}}/overviews/{{ overview.url | remove_first: '.html' }}{% endcapture %} + {% capture originalOverviewUrl %}/{{overviewroot}}{{ overview.url }}{% endcapture %} + {% capture translatedOverviewId %}/{{page.language}}/{{overviewroot}}{{ overview.url | remove_first: '.html' }}{% endcapture %} {% assign translatedOverview = site.documents | where: 'id', translatedOverviewId | first %} <a href="{{ translatedOverview.url | default: originalOverviewUrl }}"><h3>{{ overview.title }}</h3></a> </div> @@ -65,8 +70,8 @@ <h2>{{ category.category }}</h2> <strong>Contents</strong> <ul class="subdocs"> {% for doc in overview.subdocs %} - {% capture originalDocUrl %}/overviews/{{ doc.url }}{% endcapture %} - {% capture translatedDocId %}/{{page.language}}/overviews/{{ doc.url | remove_first: '.html' }}{% endcapture %} + {% capture originalDocUrl %}/{{overviewroot}}{{ doc.url }}{% endcapture %} + {% capture translatedDocId %}/{{page.language}}/{{overviewroot}}{{ doc.url | remove_first: '.html' }}{% endcapture %} {% assign translatedDoc = site.documents | where: 'id', translatedDocId | first %} <li><a href="{{ translatedDoc.url | default: originalDocUrl }}">{{ doc.title }}</a></li> {% endfor %} diff --git a/_layouts/singlepage-overview.html b/_layouts/singlepage-overview.html index 08e67dde8e..e698d1183c 100644 --- a/_layouts/singlepage-overview.html +++ b/_layouts/singlepage-overview.html @@ -8,6 +8,14 @@ <div class="content-primary documentation"> <div class="inner-box"> <div class="toc-context"> + {% if page.versionSpecific %} + {% if page.scala3 %} + {% assign versionSpecificLang = 'scala3' %} + {% else if page.scala2 %} + {% assign versionSpecificLang = 'scala2' %} + {% endif %} + {% include version-specific-notice.html language=versionSpecificLang %} + {% endif %} {{content}} </div> diff --git a/_overviews/index.md b/_overviews/index.md index 8e4a815f06..572296a85d 100644 --- a/_overviews/index.md +++ b/_overviews/index.md @@ -4,6 +4,8 @@ partof: overviews title: Guides and Overviews languages: [ja, zh-cn, ru, uk] permalink: /overviews/:title.html +redirect_from: + - /scala3/guides.html --- <!-- Auto generated from _data/overviews.yml --> diff --git a/_overviews/scala-book/abstract-classes.md b/_overviews/scala-book/abstract-classes.md index ed8dc3b147..88c496945c 100644 --- a/_overviews/scala-book/abstract-classes.md +++ b/_overviews/scala-book/abstract-classes.md @@ -9,6 +9,7 @@ num: 27 outof: 54 previous-page: traits-abstract-mixins next-page: collections-101 +new-version: /scala3/book/domain-modeling-tools.html#abstract-classes --- @@ -106,11 +107,3 @@ d.speak ``` We encourage you to copy and paste that code into the REPL to be sure that it works as expected, and then experiment with it as desired. - - - - - - - - diff --git a/_overviews/scala-book/anonymous-functions.md b/_overviews/scala-book/anonymous-functions.md index de9c9ebd14..619d8854a7 100644 --- a/_overviews/scala-book/anonymous-functions.md +++ b/_overviews/scala-book/anonymous-functions.md @@ -9,6 +9,7 @@ num: 34 outof: 54 previous-page: set-class next-page: collections-methods +new-version: /scala3/book/fun-anonymous-functions.html --- @@ -200,16 +201,3 @@ is the same as this example: ```scala val y = ints.filter(_ < 5) ``` - - - - - - - - - - - - - diff --git a/_overviews/scala-book/arraybuffer-examples.md b/_overviews/scala-book/arraybuffer-examples.md index be588f641e..06bd6d1af2 100644 --- a/_overviews/scala-book/arraybuffer-examples.md +++ b/_overviews/scala-book/arraybuffer-examples.md @@ -9,6 +9,7 @@ num: 29 outof: 54 previous-page: collections-101 next-page: list-class +new-version: /scala3/book/collections-classes.html#arraybuffer --- @@ -130,12 +131,3 @@ val a = ArrayBuffer.range('a', 'h') // ArrayBuffer(a, b, c, d, e, f, g) a.dropInPlace(2) // ArrayBuffer(c, d, e, f, g) a.dropRightInPlace(2) // ArrayBuffer(c, d, e) ``` - - - - - - - - - diff --git a/_overviews/scala-book/built-in-types.md b/_overviews/scala-book/built-in-types.md index 1567d13970..c251b9a4f1 100644 --- a/_overviews/scala-book/built-in-types.md +++ b/_overviews/scala-book/built-in-types.md @@ -9,6 +9,7 @@ num: 10 outof: 54 previous-page: type-is-optional next-page: two-notes-about-strings +new-version: /scala3/book/first-look-at-types.html#scalas-value-types --- @@ -105,10 +106,3 @@ val c: Char = 'a' ``` As shown, enclose strings in double-quotes and a character in single-quotes. - - - - - - - diff --git a/_overviews/scala-book/case-classes.md b/_overviews/scala-book/case-classes.md index 33db4a9a7f..9ffae6db23 100644 --- a/_overviews/scala-book/case-classes.md +++ b/_overviews/scala-book/case-classes.md @@ -9,6 +9,7 @@ num: 49 outof: 54 previous-page: companion-objects next-page: case-objects +new-version: /scala3/book/domain-modeling-tools.html#case-classes --- @@ -184,5 +185,3 @@ res0: Person = Person(Christina,niece) ## The biggest advantage While all of these features are great benefits to functional programming, as they write in the book, [Programming in Scala](https://www.amazon.com/Programming-Scala-Updated-2-12/dp/0981531687/) (Odersky, Spoon, and Venners), “the biggest advantage of case classes is that they support pattern matching.” Pattern matching is a major feature of FP languages, and Scala’s case classes provide a simple way to implement pattern matching in match expressions and other areas. - - diff --git a/_overviews/scala-book/case-objects.md b/_overviews/scala-book/case-objects.md index ca6a5f155a..9bb17d2ec7 100644 --- a/_overviews/scala-book/case-objects.md +++ b/_overviews/scala-book/case-objects.md @@ -9,6 +9,7 @@ num: 50 outof: 54 previous-page: case-classes next-page: functional-error-handling +new-version: /scala3/book/domain-modeling-tools.html#case-objects --- @@ -122,11 +123,3 @@ class Speak extends Actor { ``` This is a good, safe way to pass messages around in Scala applications. - - - - - - - - diff --git a/_overviews/scala-book/classes-aux-constructors.md b/_overviews/scala-book/classes-aux-constructors.md index d3af412a53..8bca7dc8cf 100644 --- a/_overviews/scala-book/classes-aux-constructors.md +++ b/_overviews/scala-book/classes-aux-constructors.md @@ -9,6 +9,7 @@ num: 20 outof: 54 previous-page: classes next-page: constructors-default-values +new-version: /scala3/book/domain-modeling-tools.html#auxiliary-constructors --- @@ -71,11 +72,3 @@ class Pizza( var crustType: String = DefaultCrustType ) ``` - - - - - - - - diff --git a/_overviews/scala-book/classes.md b/_overviews/scala-book/classes.md index c4861bc7c2..bc7928eea0 100644 --- a/_overviews/scala-book/classes.md +++ b/_overviews/scala-book/classes.md @@ -9,6 +9,7 @@ num: 19 outof: 54 previous-page: try-catch-finally next-page: classes-aux-constructors +new-version: /scala3/book/domain-modeling-tools.html#classes --- @@ -208,14 +209,3 @@ class Address ( var state: String ) ``` - - - - - - - - - - - diff --git a/_overviews/scala-book/collections-101.md b/_overviews/scala-book/collections-101.md index b98a72d116..995c20520b 100644 --- a/_overviews/scala-book/collections-101.md +++ b/_overviews/scala-book/collections-101.md @@ -9,6 +9,7 @@ num: 28 outof: 54 previous-page: abstract-classes next-page: arraybuffer-examples +new-version: /scala3/book/collections-intro.html --- @@ -33,6 +34,3 @@ The main Scala collections classes you’ll use on a regular basis are: We’ll demonstrate the basics of these classes in the following lessons. >In the following lessons on Scala collections classes, whenever we use the word *immutable*, it’s safe to assume that the class is intended for use in a *functional programming* (FP) style. With these classes you don’t modify the collection; you apply functional methods to the collection to create a new result. You’ll see what this means in the examples that follow. - - - diff --git a/_overviews/scala-book/collections-maps.md b/_overviews/scala-book/collections-maps.md index 84a9f065c4..0abc9da611 100644 --- a/_overviews/scala-book/collections-maps.md +++ b/_overviews/scala-book/collections-maps.md @@ -9,6 +9,7 @@ num: 36 outof: 54 previous-page: collections-methods next-page: misc +new-version: /scala3/book/collections-methods.html --- @@ -101,13 +102,3 @@ states.filterInPlace((k,v) => k == "AK") ## See also There are many more things you can do with maps. See the [Map class documentation]({{site.baseurl}}/overviews/collections-2.13/maps.html) for more details and examples. - - - - - - - - - - diff --git a/_overviews/scala-book/collections-methods.md b/_overviews/scala-book/collections-methods.md index e888179940..e6620ec6cc 100644 --- a/_overviews/scala-book/collections-methods.md +++ b/_overviews/scala-book/collections-methods.md @@ -9,6 +9,7 @@ num: 35 outof: 54 previous-page: anonymous-functions next-page: collections-maps +new-version: /scala3/book/collections-methods.html --- @@ -319,8 +320,3 @@ That might be a little mind-blowing if you’ve never seen it before, but after ## Even more! There are literally dozens of additional methods on the Scala sequence classes that will keep you from ever needing to write another `for` loop. However, because this is a simple introduction book they won’t all be covered here. For more information, see [the collections overview of sequence traits]({{site.baseurl}}/overviews/collections-2.13/seqs.html). - - - - - diff --git a/_overviews/scala-book/command-line-io.md b/_overviews/scala-book/command-line-io.md index 14bf2901af..b3ea6ca64c 100644 --- a/_overviews/scala-book/command-line-io.md +++ b/_overviews/scala-book/command-line-io.md @@ -9,6 +9,7 @@ num: 12 outof: 54 previous-page: two-notes-about-strings next-page: control-structures +new-version: /scala3/book/taste-hello-world.html#ask-for-user-input --- @@ -97,12 +98,3 @@ import scala.io.StdIn.readLine ``` That import statement brings the `readLine` method into the current scope so you can use it in the application. - - - - - - - - - diff --git a/_overviews/scala-book/companion-objects.md b/_overviews/scala-book/companion-objects.md index f024a8a2d5..dc8cb8b1d3 100644 --- a/_overviews/scala-book/companion-objects.md +++ b/_overviews/scala-book/companion-objects.md @@ -9,6 +9,7 @@ num: 48 outof: 54 previous-page: no-null-values next-page: case-classes +new-version: /scala3/book/domain-modeling-tools.html#companion-objects --- @@ -270,13 +271,3 @@ The key points of this lesson are: - A companion object and its class can access each other’s private members - A companion object’s `apply` method lets you create new instances of a class without using the `new` keyword - A companion object’s `unapply` method lets you de-construct an instance of a class into its individual components - - - - - - - - - - diff --git a/_overviews/scala-book/concurrency-signpost.md b/_overviews/scala-book/concurrency-signpost.md index d3435c4ede..49ab2cd094 100644 --- a/_overviews/scala-book/concurrency-signpost.md +++ b/_overviews/scala-book/concurrency-signpost.md @@ -9,8 +9,8 @@ num: 52 outof: 54 previous-page: functional-error-handling next-page: futures +new-version: /scala3/book/concurrency.html --- In the next lesson you’ll see a primary tool for writing parallel and concurrent applications, the Scala `Future`. - diff --git a/_overviews/scala-book/constructors-default-values.md b/_overviews/scala-book/constructors-default-values.md index b54da93584..952fe3fd46 100644 --- a/_overviews/scala-book/constructors-default-values.md +++ b/_overviews/scala-book/constructors-default-values.md @@ -9,6 +9,7 @@ num: 21 outof: 54 previous-page: classes-aux-constructors next-page: methods-first-look +new-version: /scala3/book/domain-modeling-tools.html#default-parameter-values --- Scala lets you supply default values for constructor parameters. For example, in previous lessons we showed that you can define a `Socket` class like this: @@ -87,12 +88,3 @@ is more readable than this code: ```scala val s = new Socket(2000, 3000) ``` - - - - - - - - - diff --git a/_overviews/scala-book/control-structures.md b/_overviews/scala-book/control-structures.md index 9d21b18eb3..8724ba7050 100644 --- a/_overviews/scala-book/control-structures.md +++ b/_overviews/scala-book/control-structures.md @@ -9,6 +9,7 @@ num: 13 outof: 54 previous-page: command-line-io next-page: if-then-else-construct +new-version: /scala3/book/control-structures.html --- @@ -24,10 +25,3 @@ It also has a few unique constructs, including: - `for` expressions We’ll demonstrate these in the following lessons. - - - - - - - diff --git a/_overviews/scala-book/enumerations-pizza-class.md b/_overviews/scala-book/enumerations-pizza-class.md index d4052378bb..abe76d8b07 100644 --- a/_overviews/scala-book/enumerations-pizza-class.md +++ b/_overviews/scala-book/enumerations-pizza-class.md @@ -9,6 +9,7 @@ num: 23 outof: 54 previous-page: methods-first-look next-page: traits-intro +new-version: /scala3/book/domain-modeling-fp.html#modeling-the-data --- @@ -185,7 +186,3 @@ Toppings: ArrayBuffer(Cheese, Pepperoni) That code combines several different concepts — including two things we haven’t discussed yet in the `import` statement and the `ArrayBuffer` — but if you have experience with Java and other languages, hopefully it’s not too much to throw at you at one time. At this point we encourage you to work with that code as desired. Make changes to the code, and try using the `removeTopping` and `removeAllToppings` methods to make sure they work the way you expect them to work. - - - - diff --git a/_overviews/scala-book/for-expressions.md b/_overviews/scala-book/for-expressions.md index 4cd666ef42..e7e5c0a90a 100644 --- a/_overviews/scala-book/for-expressions.md +++ b/_overviews/scala-book/for-expressions.md @@ -9,6 +9,7 @@ num: 16 outof: 54 previous-page: for-loops next-page: match-expressions +new-version: /scala3/book/control-structures.html#for-expressions --- @@ -124,11 +125,3 @@ You can also put curly braces around the algorithm, if you prefer: ```scala val capNames = for (name <- names) yield { name.drop(1).capitalize } ``` - - - - - - - - diff --git a/_overviews/scala-book/for-loops.md b/_overviews/scala-book/for-loops.md index ef382270f2..b462c4d289 100644 --- a/_overviews/scala-book/for-loops.md +++ b/_overviews/scala-book/for-loops.md @@ -9,6 +9,7 @@ num: 15 outof: 54 previous-page: if-then-else-construct next-page: for-expressions +new-version: /scala3/book/control-structures.html#for-loops --- @@ -106,7 +107,3 @@ ratings.foreach { case(movie, rating) => println(s"key: $movie, value: $rating") } ``` - - - - diff --git a/_overviews/scala-book/functional-error-handling.md b/_overviews/scala-book/functional-error-handling.md index 8e779a2bc2..bdbcc2f228 100644 --- a/_overviews/scala-book/functional-error-handling.md +++ b/_overviews/scala-book/functional-error-handling.md @@ -9,6 +9,7 @@ num: 51 outof: 54 previous-page: case-objects next-page: concurrency-signpost +new-version: /scala3/book/fp-functional-error-handling.html --- @@ -128,15 +129,3 @@ scala.util.Try[Int] = Failure(java.lang.NumberFormatException: For input string: There are other classes that work in a similar manner, including Either/Left/Right in the Scala library, and other third-party libraries, but Option/Some/None and Try/Success/Failure are commonly used, and good to learn first. You can use whatever you like, but Try/Success/Failure is generally used when dealing with code that can throw exceptions — because you almost always want to understand the exception — and Option/Some/None is used in other places, such as to avoid using null values. - - - - - - - - - - - - diff --git a/_overviews/scala-book/functional-programming.md b/_overviews/scala-book/functional-programming.md index dee9cc4533..806697f189 100644 --- a/_overviews/scala-book/functional-programming.md +++ b/_overviews/scala-book/functional-programming.md @@ -9,6 +9,7 @@ num: 44 outof: 54 previous-page: sbt-scalatest-bdd next-page: pure-functions +new-version: /scala3/book/fp-intro.html --- @@ -18,13 +19,3 @@ Scala lets you write code in an object-oriented programming (OOP) style, a funct *Functional programming* is a style of programming that emphasizes writing applications using only pure functions and immutable values. As Alvin Alexander wrote in [Functional Programming, Simplified](https://alvinalexander.com/scala/functional-programming-simplified-book), rather than using that description, it can be helpful to say that functional programmers have an extremely strong desire to see their code as math — to see the combination of their functions as a series of algebraic equations. In that regard, you could say that functional programmers like to think of themselves as mathematicians. That’s the driving desire that leads them to use *only* pure functions and immutable values, because that’s what you use in algebra and other forms of math. Functional programming is a large topic, and there’s no simple way to condense the entire topic into this little book, but in the following lessons we’ll give you a taste of FP, and show some of the tools Scala provides for developers to write functional code. - - - - - - - - - - diff --git a/_overviews/scala-book/futures.md b/_overviews/scala-book/futures.md index e585ff2819..8493ed1931 100644 --- a/_overviews/scala-book/futures.md +++ b/_overviews/scala-book/futures.md @@ -9,6 +9,7 @@ num: 53 outof: 54 previous-page: concurrency-signpost next-page: where-next +new-version: /scala3/book/concurrency.html --- When you want to write parallel and concurrent applications in Scala, you *could* still use the native Java `Thread` — but the Scala [Future](https://www.scala-lang.org/api/current/scala/concurrent/Future$.html) makes parallel/concurrent programming much simpler, and it’s preferred. @@ -347,12 +348,3 @@ While this was a short introduction, hopefully those examples give you an idea o - A small demo GUI application named *Future Board* was written to accompany this lesson. It works a little like [Flipboard](https://flipboard.com), updating a group of news sources simultaneously. You can find the source code for Future Board in [this Github repository](https://github.com/alvinj/FPFutures). - While futures are intended for one-short, relatively short-lived concurrent processes, [Akka](https://akka.io) is an “actor model” library for Scala, and provides a terrific way to implement long-running parallel processes. (If this term is new to you, an *actor* is a long-running process that runs in parallel to the main application thread, and responds to messages that are sent to it.) - - - - - - - - - diff --git a/_overviews/scala-book/hello-world-1.md b/_overviews/scala-book/hello-world-1.md index 28aa21f19b..d9f9ddc0c6 100644 --- a/_overviews/scala-book/hello-world-1.md +++ b/_overviews/scala-book/hello-world-1.md @@ -9,6 +9,7 @@ num: 5 outof: 54 previous-page: scala-features next-page: hello-world-2 +new-version: /scala3/book/taste-hello-world.html --- Since the release of the book, *C Programming Language*, most programming books have begun with a simple “Hello, world” example, and in keeping with tradition, here’s the source code for a Scala “Hello, world” example: @@ -86,7 +87,3 @@ public final class Hello { ```` As that output shows, the `javap` command reads that *.class* file just as if it was created from Java source code. Scala code runs on the JVM and can use existing Java libraries — and both are terrific benefits for Scala programmers. - - - - diff --git a/_overviews/scala-book/hello-world-2.md b/_overviews/scala-book/hello-world-2.md index 76d1bf053c..ac2f61cfe2 100644 --- a/_overviews/scala-book/hello-world-2.md +++ b/_overviews/scala-book/hello-world-2.md @@ -9,6 +9,7 @@ num: 6 outof: 54 previous-page: hello-world-1 next-page: scala-repl +new-version: /scala3/book/taste-hello-world.html --- While that first “Hello, World” example works just fine, Scala provides a way to write applications more conveniently. Rather than including a `main` method, your `object` can just extend the `App` trait, like this: @@ -61,15 +62,3 @@ This shows: - Command-line arguments are automatically made available to you in a variable named `args`. - You determine the number of elements in `args` with `args.size` (or `args.length`, if you prefer). - `args` is an `Array`, and you access `Array` elements as `args(0)`, `args(1)`, etc. Because `args` is an object, you access the array elements with parentheses (not `[]` or any other special syntax). - - - - - - - - - - - - diff --git a/_overviews/scala-book/if-then-else-construct.md b/_overviews/scala-book/if-then-else-construct.md index bd720f758a..7087c3340c 100644 --- a/_overviews/scala-book/if-then-else-construct.md +++ b/_overviews/scala-book/if-then-else-construct.md @@ -9,6 +9,7 @@ num: 14 outof: 54 previous-page: control-structures next-page: for-loops +new-version: /scala3/book/control-structures.html#the-ifthenelse-construct --- @@ -78,10 +79,3 @@ println("Hello") ``` The first example runs the `doSomething` method as a side effect when `a` is equal to `b`. The second example is used for the side effect of writing a string to STDOUT. As you learn more about Scala you’ll find yourself writing more *expressions* and fewer *statements*. The differences between expressions and statements will also become more apparent. - - - - - - - diff --git a/_overviews/scala-book/introduction.md b/_overviews/scala-book/introduction.md index 7b417388fb..42bfe49502 100644 --- a/_overviews/scala-book/introduction.md +++ b/_overviews/scala-book/introduction.md @@ -8,6 +8,7 @@ overview-name: Scala Book num: 1 outof: 54 next-page: prelude-taste-of-scala +new-version: /scala3/book/introduction.html --- In these pages, *Scala Book* provides a quick introduction and overview of the Scala programming language. The book is written in an informal style, and consists of more than 50 small lessons. Each lesson is long enough to give you an idea of how the language features in that lesson work, but short enough that you can read it in fifteen minutes or less. @@ -17,10 +18,3 @@ One note before beginning: - In regards to programming style, most Scala programmers indent their code with two spaces, but we use four spaces because we think it makes the code easier to read, especially in a book format. To begin reading, click the “next” link, or select the *Prelude: A Taste of Scala* lesson in the table of contents. - - - - - - - diff --git a/_overviews/scala-book/list-class.md b/_overviews/scala-book/list-class.md index 0e4e324e89..568463f1f7 100644 --- a/_overviews/scala-book/list-class.md +++ b/_overviews/scala-book/list-class.md @@ -9,6 +9,7 @@ num: 30 outof: 54 previous-page: arraybuffer-examples next-page: vector-class +new-version: /scala3/book/collections-classes.html#list --- [The List class](https://www.scala-lang.org/api/current/scala/collection/immutable/List.html) is a linear, immutable sequence. All this means is that it’s a linked-list that you can’t modify. Any time you want to add or remove `List` elements, you create a new `List` from an existing `List`. @@ -139,15 +140,3 @@ list: List[Int] = List(1, 2, 3) ``` This works because a `List` is a singly-linked list that ends with the `Nil` element. - - - - - - - - - - - - diff --git a/_overviews/scala-book/map-class.md b/_overviews/scala-book/map-class.md index 34f0824fae..88efb3eec8 100644 --- a/_overviews/scala-book/map-class.md +++ b/_overviews/scala-book/map-class.md @@ -9,6 +9,7 @@ num: 32 outof: 54 previous-page: vector-class next-page: set-class +new-version: /scala3/book/collections-classes.html#maps --- @@ -157,12 +158,3 @@ ratings.foreach { ## See also There are other ways to work with Scala Maps, and a nice collection of Map classes for different needs. See the [Map class documentation]({{site.baseurl}}/overviews/collections-2.13/maps.html) for more information and examples. - - - - - - - - - diff --git a/_overviews/scala-book/match-expressions.md b/_overviews/scala-book/match-expressions.md index 60cc0d92ae..1c19d09c07 100644 --- a/_overviews/scala-book/match-expressions.md +++ b/_overviews/scala-book/match-expressions.md @@ -9,6 +9,7 @@ num: 17 outof: 54 previous-page: for-expressions next-page: try-catch-finally +new-version: /scala3/book/control-structures.html#match-expressions --- @@ -246,11 +247,3 @@ stock match { ## Even more `match` expressions are very powerful, and there are even more things you can do with them, but hopefully these examples provide a good start towards using them. - - - - - - - - diff --git a/_overviews/scala-book/methods-first-look.md b/_overviews/scala-book/methods-first-look.md index 348c66f56f..7a8d8bb71e 100644 --- a/_overviews/scala-book/methods-first-look.md +++ b/_overviews/scala-book/methods-first-look.md @@ -9,6 +9,7 @@ num: 22 outof: 54 previous-page: constructors-default-values next-page: enumerations-pizza-class +new-version: /scala3/book/methods-intro.html --- @@ -103,9 +104,3 @@ If you paste that code into the REPL, you’ll see that it works just like the p scala> addThenDouble(1, 1) res0: Int = 4 ``` - - - - - - diff --git a/_overviews/scala-book/misc.md b/_overviews/scala-book/misc.md index 07f511305c..d7c7b77c89 100644 --- a/_overviews/scala-book/misc.md +++ b/_overviews/scala-book/misc.md @@ -9,6 +9,7 @@ num: 37 outof: 54 previous-page: collections-maps next-page: tuples +new-version: /scala3/book/introduction.html --- @@ -16,5 +17,3 @@ In this section we’ll cover a few miscellaneous items about Scala: - Tuples - A Scala OOP example of a pizza restaurant order-entry system - - diff --git a/_overviews/scala-book/no-null-values.md b/_overviews/scala-book/no-null-values.md index 194348c246..66771927f0 100644 --- a/_overviews/scala-book/no-null-values.md +++ b/_overviews/scala-book/no-null-values.md @@ -9,6 +9,7 @@ num: 47 outof: 54 previous-page: passing-functions-around next-page: companion-objects +new-version: /scala3/book/fp-functional-error-handling.html --- @@ -300,10 +301,3 @@ This lesson was a little longer than the others, so here’s a quick review of t ## See also - Tony Hoare invented the null reference in 1965, and refers to it as his “[billion dollar mistake](https://en.wikipedia.org/wiki/Tony_Hoare#Apologies_and_retractions).” - - - - - - - diff --git a/_overviews/scala-book/oop-pizza-example.md b/_overviews/scala-book/oop-pizza-example.md index c70df45e3f..e3890b7c1d 100644 --- a/_overviews/scala-book/oop-pizza-example.md +++ b/_overviews/scala-book/oop-pizza-example.md @@ -9,6 +9,7 @@ num: 39 outof: 54 previous-page: tuples next-page: sbt-scalatest-intro +new-version: /scala3/book/domain-modeling-oop.html --- @@ -216,8 +217,3 @@ To experiment with this on your own, please see the *PizzaOopExample* project in - [github.com/alvinj/HelloScalaExamples](https://github.com/alvinj/HelloScalaExamples) To compile this project it will help to either (a) use IntelliJ IDEA or Eclipse, or (b) know how to use the [Scala Build Tool](http://www.scala-sbt.org). - - - - - diff --git a/_overviews/scala-book/passing-functions-around.md b/_overviews/scala-book/passing-functions-around.md index 80c6cd2f2b..91ca50d198 100644 --- a/_overviews/scala-book/passing-functions-around.md +++ b/_overviews/scala-book/passing-functions-around.md @@ -9,6 +9,7 @@ num: 46 outof: 54 previous-page: pure-functions next-page: no-null-values +new-version: /scala3/book/fp-functions-are-values.html --- @@ -103,11 +104,3 @@ Those examples that use a “regular” function are equivalent to these anonymo List("foo", "bar").map(s => s.toUpperCase) List("foo", "bar").map(_.toUpperCase) ``` - - - - - - - - diff --git a/_overviews/scala-book/preliminaries.md b/_overviews/scala-book/preliminaries.md index ac3af5ea33..c721907432 100644 --- a/_overviews/scala-book/preliminaries.md +++ b/_overviews/scala-book/preliminaries.md @@ -9,6 +9,7 @@ num: 3 outof: 54 previous-page: prelude-taste-of-scala next-page: scala-features +new-version: /scala3/book/taste-intro.html#setting-up-scala --- @@ -59,12 +60,3 @@ Another good thing to know is that Scala naming conventions follow the same “c - Class names: `Person`, `StoreEmployee` - Variable names: `name`, `firstName` - Method names: `convertToInt`, `toUpper` - - - - - - - - - diff --git a/_overviews/scala-book/prelude-taste-of-scala.md b/_overviews/scala-book/prelude-taste-of-scala.md index aba0111219..be181e9433 100644 --- a/_overviews/scala-book/prelude-taste-of-scala.md +++ b/_overviews/scala-book/prelude-taste-of-scala.md @@ -9,6 +9,7 @@ num: 2 outof: 54 previous-page: introduction next-page: preliminaries +new-version: /scala3/book/taste-intro.html --- Our hope in this book is to demonstrate that [Scala](http://scala-lang.org) is a beautiful, modern, expressive programming language. To help demonstrate that, in this first chapter we’ll jump right in and provide a whirlwind tour of Scala’s main features. After this tour, the book begins with a more traditional “Getting Started” chapter. @@ -552,11 +553,3 @@ If you like what you’ve seen so far, we hope you’ll like the rest of the boo ## A bit of background Scala was created by [Martin Odersky](https://en.wikipedia.org/wiki/Martin_Odersky), who studied under [Niklaus Wirth](https://en.wikipedia.org/wiki/Niklaus_Wirth), who created Pascal and several other languages. Mr. Odersky is one of the co-designers of Generic Java, and is also known as the “father” of the `javac` compiler. - - - - - - - - diff --git a/_overviews/scala-book/pure-functions.md b/_overviews/scala-book/pure-functions.md index 5bbb4f50c2..35597bd01a 100644 --- a/_overviews/scala-book/pure-functions.md +++ b/_overviews/scala-book/pure-functions.md @@ -9,6 +9,7 @@ num: 45 outof: 54 previous-page: functional-programming next-page: passing-functions-around +new-version: /scala3/book/fp-pure-functions.html --- @@ -99,19 +100,3 @@ The first key point of this lesson is the definition of a pure function: >A *pure function* is a function that depends only on its declared inputs and its internal algorithm to produce its output. It does not read any other values from “the outside world” — the world outside of the function’s scope — and it does not modify any values in the outside world. A second key point is that real-world applications consist of a combination of pure and impure functions. A common recommendation is to write the core of your application using pure functions, and then to use impure functions to communicate with the outside world. - - - - - - - - - - - - - - - - diff --git a/_overviews/scala-book/sbt-scalatest-bdd.md b/_overviews/scala-book/sbt-scalatest-bdd.md index a09f16d9e1..5a06f9764f 100644 --- a/_overviews/scala-book/sbt-scalatest-bdd.md +++ b/_overviews/scala-book/sbt-scalatest-bdd.md @@ -9,6 +9,7 @@ num: 43 outof: 54 previous-page: sbt-scalatest-tdd next-page: functional-programming +new-version: /scala3/book/tools-sbt.html#using-sbt-with-scalatest --- @@ -114,11 +115,3 @@ For more information about sbt and ScalaTest, see the following resources: - [The main sbt documentation](http://www.scala-sbt.org/documentation.html) - [The ScalaTest documentation](http://www.scalatest.org/user_guide) - - - - - - - - diff --git a/_overviews/scala-book/sbt-scalatest-intro.md b/_overviews/scala-book/sbt-scalatest-intro.md index e7f8d20bed..2c80d06799 100644 --- a/_overviews/scala-book/sbt-scalatest-intro.md +++ b/_overviews/scala-book/sbt-scalatest-intro.md @@ -9,6 +9,7 @@ num: 40 outof: 54 previous-page: oop-pizza-example next-page: scala-build-tool-sbt +new-version: /scala3/book/tools-sbt.html --- @@ -18,5 +19,3 @@ In the next few lessons you’ll see a couple of tools that are commonly used in - [ScalaTest](http://www.scalatest.org), a code testing framework We’ll start by showing how to use sbt, and then you’ll see how to use ScalaTest and sbt together to build and test your Scala projects. - - diff --git a/_overviews/scala-book/sbt-scalatest-tdd.md b/_overviews/scala-book/sbt-scalatest-tdd.md index 64a9d39bc2..83776d3712 100644 --- a/_overviews/scala-book/sbt-scalatest-tdd.md +++ b/_overviews/scala-book/sbt-scalatest-tdd.md @@ -9,6 +9,7 @@ num: 42 outof: 54 previous-page: scala-build-tool-sbt next-page: sbt-scalatest-bdd +new-version: /scala3/book/tools-sbt.html#using-sbt-with-scalatest --- @@ -158,11 +159,3 @@ Now you can run these tests with the `sbt test` command. Skipping the first few This example demonstrates a *Test-Driven Development* (TDD) style of testing with ScalaTest. In the next lesson you’ll see how to write *Behavior-Driven Development* (BDD) tests with ScalaTest and sbt. >Keep the project you just created. You’ll use it again in the next lesson. - - - - - - - - diff --git a/_overviews/scala-book/scala-build-tool-sbt.md b/_overviews/scala-book/scala-build-tool-sbt.md index aefb28ecea..ebc04193a9 100644 --- a/_overviews/scala-book/scala-build-tool-sbt.md +++ b/_overviews/scala-book/scala-build-tool-sbt.md @@ -9,6 +9,7 @@ num: 41 outof: 54 previous-page: sbt-scalatest-intro next-page: sbt-scalatest-tdd +new-version: /scala3/book/tools-sbt.html#building-scala-projects-with-sbt --- @@ -162,12 +163,3 @@ Here’s a list of other build tools you can use to build Scala projects: - [Maven](https://maven.apache.org/) - [Fury](https://propensive.com/opensource/fury) - [Mill](https://com-lihaoyi.github.io/mill/) - - - - - - - - - diff --git a/_overviews/scala-book/scala-features.md b/_overviews/scala-book/scala-features.md index c7d7387d4a..79aefdc352 100644 --- a/_overviews/scala-book/scala-features.md +++ b/_overviews/scala-book/scala-features.md @@ -9,6 +9,7 @@ num: 4 outof: 54 previous-page: preliminaries next-page: hello-world-1 +new-version: /scala3/book/scala-features.html --- @@ -27,6 +28,3 @@ Here are a few more nuggets about Scala: - Scala also works extremely well with the thousands of Java libraries that have been developed over the years. - A great thing about Scala is that you can be productive with it on Day 1, but it’s also a deep language, so as you go along you’ll keep learning, and finding newer, better ways to write code. Some people say that Scala will change the way you think about programming (and that’s a good thing). - A great Scala benefit is that it lets you write concise, readable code. The time a programmer spends reading code compared to the time spent writing code is said to be at least a 10:1 ratio, so writing code that’s *concise and readable* is a big deal. Because Scala has these attributes, programmers say that it’s *expressive*. - - - diff --git a/_overviews/scala-book/scala-repl.md b/_overviews/scala-book/scala-repl.md index 062ca12b7f..844a6397e7 100644 --- a/_overviews/scala-book/scala-repl.md +++ b/_overviews/scala-book/scala-repl.md @@ -9,6 +9,7 @@ num: 7 outof: 54 previous-page: hello-world-2 next-page: two-types-variables +new-version: /scala3/book/taste-repl.html --- @@ -75,10 +76,3 @@ In addition to the REPL there are a couple of other, similar tools you can use: - [scalafiddle.io](https://scalafiddle.io) lets you run similar experiments in a web browser For more information on the Scala REPL, see the [Scala REPL overview]({{site.baseurl}}/overviews/repl/overview.html) - - - - - - - diff --git a/_overviews/scala-book/set-class.md b/_overviews/scala-book/set-class.md index dc69cb2ae4..6123650f6f 100644 --- a/_overviews/scala-book/set-class.md +++ b/_overviews/scala-book/set-class.md @@ -9,6 +9,7 @@ num: 33 outof: 54 previous-page: map-class next-page: anonymous-functions +new-version: /scala3/book/collections-classes.html#working-with-sets --- @@ -121,11 +122,3 @@ res3: Boolean = false ## More Sets Scala has several more `Set` classes, including `SortedSet`, `LinkedHashSet`, and more. Please see the [Set class documentation]({{site.baseurl}}/overviews/collections-2.13/sets.html) for more details on those classes. - - - - - - - - diff --git a/_overviews/scala-book/traits-abstract-mixins.md b/_overviews/scala-book/traits-abstract-mixins.md index db3ab56d63..1bcbb87936 100644 --- a/_overviews/scala-book/traits-abstract-mixins.md +++ b/_overviews/scala-book/traits-abstract-mixins.md @@ -9,6 +9,7 @@ num: 26 outof: 54 previous-page: traits-interfaces next-page: abstract-classes +new-version: /scala3/book/domain-modeling-tools.html#traits --- @@ -194,12 +195,3 @@ I'm running ``` This example works because all of the methods in the `TailWagger` and `Runner` traits are defined (they’re not abstract). - - - - - - - - - diff --git a/_overviews/scala-book/traits-interfaces.md b/_overviews/scala-book/traits-interfaces.md index f422f158bc..1aab8ee4e8 100644 --- a/_overviews/scala-book/traits-interfaces.md +++ b/_overviews/scala-book/traits-interfaces.md @@ -9,6 +9,7 @@ num: 25 outof: 54 previous-page: traits-intro next-page: traits-abstract-mixins +new-version: /scala3/book/domain-modeling-tools.html#traits --- ## Using Scala Traits as Interfaces @@ -145,10 +146,3 @@ Key points of this code: - Use `with` to extend subsequent traits From what you’ve seen so far, Scala traits work just like Java interfaces. But there’s more ... - - - - - - - diff --git a/_overviews/scala-book/traits-intro.md b/_overviews/scala-book/traits-intro.md index 75656b4a64..66c7cf99d6 100644 --- a/_overviews/scala-book/traits-intro.md +++ b/_overviews/scala-book/traits-intro.md @@ -9,14 +9,10 @@ num: 24 outof: 54 previous-page: enumerations-pizza-class next-page: traits-interfaces +new-version: /scala3/book/domain-modeling-tools.html#traits --- Scala traits are a great feature of the language. As you’ll see in the following lessons, you can use them just like a Java interface, and you can also use them like abstract classes that have real methods. Scala classes can also extend and “mix in” multiple traits. Scala also has the concept of an abstract class, and we’ll show when you should use an abstract class instead of a trait. - - - - - diff --git a/_overviews/scala-book/try-catch-finally.md b/_overviews/scala-book/try-catch-finally.md index 607bf3fc0b..a9e855cce1 100644 --- a/_overviews/scala-book/try-catch-finally.md +++ b/_overviews/scala-book/try-catch-finally.md @@ -9,6 +9,7 @@ num: 18 outof: 54 previous-page: match-expressions next-page: classes +new-version: /scala3/book/control-structures.html#trycatchfinally --- @@ -57,9 +58,3 @@ catch { ## More later We’ll cover more details about Scala’s try/catch/finally syntax in later lessons, such as in the “Functional Error Handling” lessons, but these examples demonstrate how the syntax works. A great thing about the syntax is that it’s consistent with the `match` expression syntax. This makes your code consistent and easier to read, and you don’t have to remember a special/different syntax. - - - - - - diff --git a/_overviews/scala-book/tuples.md b/_overviews/scala-book/tuples.md index 568037274b..dab29195c8 100644 --- a/_overviews/scala-book/tuples.md +++ b/_overviews/scala-book/tuples.md @@ -9,6 +9,7 @@ num: 38 outof: 54 previous-page: misc next-page: oop-pizza-example +new-version: /scala3/book/taste-collections.html#tuples --- @@ -114,9 +115,3 @@ For cases like this where it feels like overkill to create a class for the metho ## Tuples aren’t collections Technically, Scala 2.x tuples aren’t collections classes, they’re just a convenient little container. Because they aren’t a collection, they don’t have methods like `map`, `filter`, etc. - - - - - - diff --git a/_overviews/scala-book/two-notes-about-strings.md b/_overviews/scala-book/two-notes-about-strings.md index dea6f3e643..131c37f4f1 100644 --- a/_overviews/scala-book/two-notes-about-strings.md +++ b/_overviews/scala-book/two-notes-about-strings.md @@ -9,6 +9,7 @@ num: 11 outof: 54 previous-page: built-in-types next-page: command-line-io +new-version: /scala3/book/first-look-at-types.html#two-notes-about-strings --- @@ -109,6 +110,3 @@ our fathers ... ``` Because this is what you generally want, this is a common way to create multiline strings. - - - diff --git a/_overviews/scala-book/two-types-variables.md b/_overviews/scala-book/two-types-variables.md index f369c66a87..8c6a105c79 100644 --- a/_overviews/scala-book/two-types-variables.md +++ b/_overviews/scala-book/two-types-variables.md @@ -9,6 +9,7 @@ num: 8 outof: 54 previous-page: scala-repl next-page: type-is-optional +new-version: /scala3/book/taste-vars-data-types.html --- @@ -111,12 +112,3 @@ age: Int = 19 ``` `val` fields can’t be redefined like that in the real world, but they can be redefined in the REPL playground. - - - - - - - - - diff --git a/_overviews/scala-book/type-is-optional.md b/_overviews/scala-book/type-is-optional.md index 0d8b0a1c93..6a49d6b751 100644 --- a/_overviews/scala-book/type-is-optional.md +++ b/_overviews/scala-book/type-is-optional.md @@ -9,6 +9,7 @@ num: 9 outof: 54 previous-page: two-types-variables next-page: built-in-types +new-version: /scala3/book/taste-vars-data-types.html#declaring-variable-types --- @@ -55,13 +56,3 @@ val p: Person = new Person("Candy") // unnecessarily verbose ## Use the explicit form when you need to be clear One place where you’ll want to show the data type is when you want to be clear about what you’re creating. That is, if you don’t explicitly declare the data type, the compiler may make a wrong assumption about what you want to create. Some examples of this are when you want to create numbers with specific data types. We show this in the next lesson. - - - - - - - - - - diff --git a/_overviews/scala-book/vector-class.md b/_overviews/scala-book/vector-class.md index 1c17c9183c..7da81e3125 100644 --- a/_overviews/scala-book/vector-class.md +++ b/_overviews/scala-book/vector-class.md @@ -9,6 +9,7 @@ num: 31 outof: 54 previous-page: list-class next-page: map-class +new-version: /scala3/book/collections-classes.html#vector --- [The Vector class](https://www.scala-lang.org/api/current/scala/collection/immutable/Vector.html) is an indexed, immutable sequence. The “indexed” part of the description means that you can access `Vector` elements very rapidly by their index value, such as accessing `listOfPeople(999999)`. @@ -95,11 +96,3 @@ Joel Chris Ed ``` - - - - - - - - diff --git a/_overviews/scala-book/where-next.md b/_overviews/scala-book/where-next.md index 6bce221a97..9210e690e7 100644 --- a/_overviews/scala-book/where-next.md +++ b/_overviews/scala-book/where-next.md @@ -8,10 +8,9 @@ overview-name: Scala Book num: 54 outof: 54 previous-page: futures +new-version: /scala3/book/where-next.html --- We hope you enjoyed this introduction to the Scala programming language, and we also hope we were able to share some of the beauty of the language. As you continue working with Scala, you can find many more details at the [Guides and Overviews section]({{site.baseurl}}/overviews/index.html) of our website. - - diff --git a/_overviews/scala3-book/introduction.md b/_overviews/scala3-book/introduction.md index 3d3558203d..8533dca2b5 100644 --- a/_overviews/scala3-book/introduction.md +++ b/_overviews/scala3-book/introduction.md @@ -12,6 +12,12 @@ The goal of this book is to provide an informal introduction to the Scala langua It touches on all Scala topics, in a relatively light manner. If at any time while you’re reading this book and want more information on a specific feature, you’ll find links to our [_Reference_ documentation][reference], which covers many new features of the Scala language in more detail. +<blockquote class="help-info"> +<i class="fa fa-info"></i>  If you are interested in the archived Scala 2 edition of the book, you +can <a href="/overviews/scala-book/introduction.html">access it here</a>. We are currently in the process of +merging the two books and you can <a href="{% link scala3/contribute-to-docs.md %}">help us</a>. +</blockquote> + Over the course of this book, we hope to demonstrate that Scala is a beautiful, expressive programming language, with a clean, modern syntax, which supports functional programming (FP) and object-oriented programming (OOP), and that provides a safe static type system. Scala’s syntax, grammar, and features have been re-thought, debated in an open process, and updated in 2020 to be clearer and easier to understand than ever before. @@ -22,9 +28,5 @@ After that tour, the sections that follow it provide more details on those langu We should have a link structure on the whole tour here {% endcomment %} -> We are still in the process of writing the book. -> You can [help us improve it][contributing] - -[contributing]: {% link scala3/contribute-to-docs.md %} [reference]: {{ site.scala3ref }}/overview.html [taste]: {% link _overviews/scala3-book/taste-intro.md %} diff --git a/_overviews/scala3-book/scala-for-python-devs.md b/_overviews/scala3-book/scala-for-python-devs.md index 579095ae1c..0b11204ffa 100644 --- a/_overviews/scala3-book/scala-for-python-devs.md +++ b/_overviews/scala3-book/scala-for-python-devs.md @@ -4,7 +4,7 @@ type: chapter description: This page is for Python developers who are interested in learning about Scala 3. num: 75 previous-page: scala-for-javascript-devs -next-page: +next-page: where-next --- {% include_relative scala4x.css %} diff --git a/_overviews/scala3-book/taste-hello-world.md b/_overviews/scala3-book/taste-hello-world.md index 110d55ba91..5b9cb962ef 100644 --- a/_overviews/scala3-book/taste-hello-world.md +++ b/_overviews/scala3-book/taste-hello-world.md @@ -7,9 +7,10 @@ previous-page: taste-intro next-page: taste-repl --- +## Your First Scala Program A Scala 3 “Hello, world!” example goes as follows. -First, put this code in a file named _Hello.scala_: +First, put this code in a file named _hello.scala_: ```scala @main def hello() = println("Hello, world!") @@ -22,17 +23,17 @@ It prints the `"Hello, world!"` string to standard output (STDOUT) using the `pr Next, compile the code with `scalac`: ```bash -$ scalac Hello.scala +$ scalac hello.scala ``` If you’re coming to Scala from Java, `scalac` is just like `javac`, so that command creates several files: ```bash $ ls -1 -Hello$package$.class -Hello$package.class -Hello$package.tasty -Hello.scala +hello$package$.class +hello$package.class +hello$package.tasty +hello.scala hello.class hello.tasty ``` @@ -50,6 +51,69 @@ Assuming that worked, congratulations, you just compiled and ran your first Scal > More information about sbt and other tools that make Scala development easier can be found in the [Scala Tools][scala_tools] chapter. -[scala_tools]: {% link _overviews/scala3-book/scala-tools.md %} +## Ask For User Input + +In our next example let's ask for the user's name before we greet them! + +There are several ways to read input from a command-line, but a simple way is to use the +`readLine` method in the _scala.io.StdIn_ object. To use it, you need to first import it, like this: + +```scala +import scala.io.StdIn.readLine +``` + +To demonstrate how this works, let’s create a little example. Put this source code in a file named _helloInteractive.scala_: + +```scala +import scala.io.StdIn.readLine + +@main def helloInteractive() = + println("Please enter your name:") + val name = readLine() + + println("Hello, " + name + "!") +``` +In this code we save the result of `readLine` to a variable called `name`, we then +use the `+` operator on strings to join `"Hello, "` with `name` and `"!"`, making one single string value. +> You can learn more about using `val` by reading [Variables and Data Types](/scala3/book/taste-vars-data-types.html). + +Then compile the code with `scalac`: + +```bash +$ scalac helloInteractive.scala +``` +Then run it with `scala helloInteractive`, this time the program will pause after asking for your name, +and wait until you type a name and press return on the keyboard, looking like this: + +```bash +$ scala helloInteractive +Please enter your name: +▌ +``` + +When you enter your name at the prompt, the final interaction should look like this: + +```bash +$ scala helloInteractive +Please enter your name: +Alvin Alexander +Hello, Alvin Alexander! +``` + +### A Note about Imports + +As you saw in this application, sometimes certain methods, or other kinds of definitions that we'll see later, +are not available unless you use an `import` clause like so: + +```scala +import scala.io.StdIn.readLine +``` + +Imports help you write code in a few ways: + - you can put code in multiple files, to help avoid clutter, and to help navigate large projects. + - you can use a code library, perhaps written by someone else, that has useful functionality + - you can know where a certain definition comes from (especially if it was not written in the current file). + +[scala_tools]: {% link _overviews/scala3-book/scala-tools.md %} diff --git a/_overviews/scala3-book/taste-intro.md b/_overviews/scala3-book/taste-intro.md index 044bf7fa93..9c189ab9a5 100644 --- a/_overviews/scala3-book/taste-intro.md +++ b/_overviews/scala3-book/taste-intro.md @@ -11,7 +11,15 @@ next-page: taste-hello-world This chapter provides a whirlwind tour of the main features of the Scala 3 programming language. After this initial tour, the rest of the book provides more details on these features, and the [Reference documentation][reference] provides _many_ more details. -> Throughout this book, we recommend you to experiment with the examples on [Scastie](https://scastie.scala-lang.org), or in the Scala REPL, which is demonstrated shortly. +## Setting Up Scala + +Througout this chapter, and the rest of the book, we encourage you to try out the examples by either copying +them or typing them out manually. The tools necessary to follow along with the examples on your own computer +can be installed by following our [getting started guide][get-started]. + +> Alternatively you can run the examples in a web browser with [Scastie](https://scastie.scala-lang.org), a +> fully online editor and code-runner for Scala. [reference]: {{ site.scala3ref }}/overview.html +[get-started]: {% link _getting-started/index.md %} diff --git a/_overviews/scala3-book/where-next.md b/_overviews/scala3-book/where-next.md new file mode 100644 index 0000000000..9b9a148e5a --- /dev/null +++ b/_overviews/scala3-book/where-next.md @@ -0,0 +1,15 @@ +--- +title: Where To Go Next +type: chapter +description: Where to go next after reading the Scala Book +num: 76 +previous-page: scala-for-python-devs +next-page: +--- + +We hope you enjoyed this introduction to the Scala programming language, and we also hope we were able to share some of the beauty of the language. + +As you continue working with Scala, you can find many more details at the +[Guides and Overviews section][overviews] of our website. + +[overviews]: {% link _overviews/index.md %} diff --git a/_sass/layout/title-page.scss b/_sass/layout/title-page.scss index e0a5353faf..208f0b9565 100755 --- a/_sass/layout/title-page.scss +++ b/_sass/layout/title-page.scss @@ -2,8 +2,8 @@ //------------------------------------------------ //------------------------------------------------ -.scala3 .title-page { - background: $brand-tertiary-dotty; +.outdated-page .title-page { + background: $brand-tertiary-outdated; } .title-page { diff --git a/_sass/layout/toc.scss b/_sass/layout/toc.scss index 0e5e7f71d1..e4e284bd64 100644 --- a/_sass/layout/toc.scss +++ b/_sass/layout/toc.scss @@ -15,6 +15,11 @@ display: none; } + // disable floating for the book, since the TOC can become very large + &.book { + position: relative; + } + .contents { font-weight: 700; } @@ -83,11 +88,6 @@ } } -// disable floating for the book, since the TOC can become very large -.scala3 .sidebar-toc-wrapper { - position: relative; -} - .book #toc { ul { margin-top: 5px; diff --git a/_sass/layout/type-md.scss b/_sass/layout/type-md.scss index f4b70816bc..4cf5c57b3a 100755 --- a/_sass/layout/type-md.scss +++ b/_sass/layout/type-md.scss @@ -212,6 +212,11 @@ font-style: italic; @include border-radius($border-radius-base); + &.help-info { + border: 2px dashed $brand-tertiary-dotty; + color: $brand-tertiary-dotty; + } + p { margin: 0; } diff --git a/_sass/utils/_variables.scss b/_sass/utils/_variables.scss index f99d09cd96..630716433a 100755 --- a/_sass/utils/_variables.scss +++ b/_sass/utils/_variables.scss @@ -7,6 +7,7 @@ $brand-primary: #DC322F; $brand-secondary: #859900; $brand-tertiary: #5CC6E4; +$brand-tertiary-outdated: #a9c0c6; $brand-tertiary-dotty: #E45C77; //------------------------------------------------- $gray-darker: #002B36; diff --git a/_uk/getting-started/index.md b/_uk/getting-started/index.md index 0079a2128f..875d9176c6 100644 --- a/_uk/getting-started/index.md +++ b/_uk/getting-started/index.md @@ -4,6 +4,8 @@ title: Перші кроки partof: getting-started language: uk includeTOC: true +redirect_from: + - /uk/scala3/getting-started.html # we deleted the scala 3 version of this page --- {% include _uk/getting-started.md %} diff --git a/_uk/scala3/getting-started.md b/_uk/scala3/getting-started.md deleted file mode 100644 index 4c2acc6bf7..0000000000 --- a/_uk/scala3/getting-started.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -layout: singlepage-overview -title: Перші кроки з Scala 3 -scala3: true -language: uk ---- - -{% include _uk/getting-started.md %} diff --git a/index.md b/index.md index 7990a48ba5..13b277c86d 100644 --- a/index.md +++ b/index.md @@ -1,63 +1,16 @@ --- -layout: documentation +layout: inner-page-documentation languages: [ja, zh-cn, ru, uk] -title: Documentation +title: Learn Scala namespace: root discourse: true partof: documentation more-resources-label: More Resources +redirect_from: + - /scala3/ + - /scala3/index.html -scala3-sections: - - title: "First steps" - links: - - title: "New in Scala 3" - description: "An overview of the exciting new features in Scala 3." - icon: "fa fa-star" - link: /scala3/new-in-scala3.html - - title: "Getting Started" - description: "Install Scala 3 on your computer and start writing some Scala code!" - icon: "fa fa-rocket" - link: /scala3/getting-started.html - - title: "Scala 3 Book" - description: "Learn Scala by reading a series of short lessons." - icon: "fa fa-book-open" - link: /scala3/book/introduction.html - - title: "More detailed information" - links: - - title: "Migration Guide" - description: "A guide to help you move from Scala 2 to Scala 3." - icon: "fa fa-suitcase" - link: /scala3/guides/migration/compatibility-intro.html - - title: "Guides" - description: "Detailed guides about particular aspects of the language." - icon: "fa fa-map" - link: /scala3/guides.html - - title: "Scala Library API" - description: "API documentation for every version of the Scala 3 standard library." - icon: "fa fa-file-alt" - link: https://scala-lang.org/api/3.x/ - - title: "Language Reference" - description: "The Scala 3 language reference." - icon: "fa fa-book" - link: https://docs.scala-lang.org/scala3/reference - - title: "Scala 3 Contributing Guide" - description: "Guide to the Scala 3 Compiler and fixing an issue" - icon: "fa fa-cogs" - link: /scala3/guides/contribution/contribution-intro.html - - title: "All new Scaladoc for Scala 3" - description: "Highlights of new features for Scaladoc" - icon: "fa fa-star" - link: /scala3/scaladoc.html - - title: "Talks" - description: "Talks about Scala 3 that can be watched online" - icon: "fa fa-play-circle" - link: /scala3/talks.html - - title: "Online Courses" - description: "MOOCs to learn Scala, for beginners and experienced programmers." - icon: "fa fa-cloud" - link: /online-courses.html - -scala2-sections: +sections: - title: "First Steps..." links: - title: "Getting Started" @@ -68,10 +21,10 @@ scala2-sections: description: "Bite-sized introductions to core language features." icon: "fa fa-flag" link: /tour/tour-of-scala.html - - title: "Scala Book" + - title: "Scala 3 Book" description: "Learn Scala by reading a series of short lessons." icon: "fa fa-book-open" - link: /overviews/scala-book/introduction.html + link: /scala3/book/introduction.html - title: Online Courses description: "MOOCs to learn Scala, for beginners and experienced programmers." icon: "fa fa-cloud" @@ -111,6 +64,29 @@ scala2-sections: description: "Scala's formal language specification." icon: "fa fa-book" link: https://scala-lang.org/files/archive/spec/2.13/ + - title: "Scala 3 Language Reference" + description: "The Scala 3 language reference." + icon: "fa fa-book" + link: https://docs.scala-lang.org/scala3/reference + + - title: "Explore Scala 3" + links: + - title: "Migration Guide" + description: "A guide to help you move from Scala 2 to Scala 3." + icon: "fa fa-suitcase" + link: /scala3/guides/migration/compatibility-intro.html + - title: "New in Scala 3" + description: "An overview of the exciting new features in Scala 3." + icon: "fa fa-star" + link: /scala3/new-in-scala3.html + - title: "All new Scaladoc for Scala 3" + description: "Highlights of new features for Scaladoc" + icon: "fa fa-star" + link: /scala3/scaladoc.html + - title: "Talks" + description: "Talks about Scala 3 that can be watched online" + icon: "fa fa-play-circle" + link: /scala3/talks.html - title: "Scala Evolution" links: @@ -119,7 +95,11 @@ scala2-sections: icon: "fa fa-cogs" link: /sips/index.html - title: "Contributing to Scala" - description: "The Complete Guide to Contributing to the Scala Project" + description: "The Complete Guide to Contributing to Scala's compilers, libraries and documentation." icon: "fa fa-cogs" link: /contribute/ + - title: "Scala 3 Contributing Guide" + description: "Guide to the Scala 3 Compiler and fixing an issue" + icon: "fa fa-cogs" + link: /scala3/guides/contribution/contribution-intro.html --- diff --git a/online-courses.md b/online-courses.md index a59625fca5..76497acc09 100644 --- a/online-courses.md +++ b/online-courses.md @@ -1,7 +1,6 @@ --- title: Online Courses from The Scala Center layout: singlepage-overview -scala3: true testimonials: - /resources/images/online-courses/testimonial000.jpg - /resources/images/online-courses/testimonial001.jpg @@ -167,4 +166,3 @@ You can find other online resources contributed by the community on [Big Data Analysis with Scala and Spark]: https://www.coursera.org/learn/scala-spark-big-data [Functional Programming in Scala Capstone]: https://www.coursera.org/learn/scala-capstone [Programming Reactive Systems]: https://www.coursera.org/learn/scala-akka-reactive - diff --git a/scala3/guides.md b/scala3/guides.md deleted file mode 100644 index 26110b10ba..0000000000 --- a/scala3/guides.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -layout: inner-page-parent -title: Guides on Scala 3 - -guides: - - title: "Migration from Scala 2 to Scala 3" - icon: suitcase - url: "/scala3/guides/migration/compatibility-intro.html" - description: "Everything you need to know about compatibility and migration to Scala 3." - - title: Macros - by: Nicolas Stucki - icon: magic - url: "/scala3/guides/macros" - description: "A detailed tutorial to cover all the features involved in writing macros in Scala 3." - label-text: feature - - title: An Overview of TASTy - by: Alvin Alexander - icon: birthday-cake - url: "/scala3/guides/tasty-overview.html" - description: "An overview over the TASTy format aimed at end-users of the Scala language." - - title: "Scala 3 Contributing Guide" - by: Jamie Thompson, Anatolii Kmetiuk - icon: cogs - url: "/scala3/guides/contribution/contribution-intro.html" - description: "Guide to the Scala 3 Compiler and fixing an issue" - - title: Scaladoc - by: Krzysztof Romanowski, Aleksander Boruch-Gruszecki, Andrzej Ratajczak, Kacper Korban, Filip Zybała - icon: book - url: "/scala3/guides/scaladoc" - description: "Scala’s API documentation generation tool." ---- - -<section class="full-width"> - <div class="wrap"> - <div class="content-primary overviews"> - <div class="inner-box toc-context"> - <h2>Overviews and Guides</h2> - <p> - Detailed guides about the Scala 3 language and its features. - </p> -{% include scala3-guides-card-group.html %} - </div> - </div> - </div> -</section> diff --git a/scala3/guides/tasty-overview.md b/scala3/guides/tasty-overview.md index 1bf643bebd..835bd28497 100644 --- a/scala3/guides/tasty-overview.md +++ b/scala3/guides/tasty-overview.md @@ -1,6 +1,8 @@ --- layout: singlepage-overview title: An Overview of TASTy +scala3: true +versionSpecific: true --- If you create a Scala 3 source code file named _Hello.scala_: diff --git a/scala3/index.md b/scala3/index.md deleted file mode 100644 index 3dcea8d2b7..0000000000 --- a/scala3/index.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -layout: inner-page-documentation -title: Documentation for Scala 3 -namespace: root -partof: scala3 -discourse: true -# Content masthead links -more-resources-label: More Resources -sections: - - - title: "First Steps" - links: - - title: "New in Scala 3" - description: "An overview of the exciting new features in Scala 3." - icon: "fa fa-star" - link: /scala3/new-in-scala3.html - - title: "Getting Started" - description: "Install Scala 3 on your computer and start writing some Scala code!" - icon: "fa fa-rocket" - link: /scala3/getting-started.html - - title: "Scala 3 Book" - description: "An online book introducing the main language features." - icon: "fa fa-book" - link: /scala3/book/introduction.html - - title: "More Detailed Information" - links: - - title: "Migration Guide" - description: "A guide to help you move from Scala 2.13 to Scala 3." - icon: "fa fa-suitcase" - link: /scala3/guides/migration/compatibility-intro.html - - title: "Guides" - description: "Detailed guides about particular aspects of the language." - icon: "fa fa-map" - link: /scala3/guides.html - - title: "API" - description: "API documentation for every version of Scala 3." - icon: "fa fa-file-alt" - link: https://scala-lang.org/api/3.x/ - - title: "Language Reference" - description: "The Scala 3 language reference." - icon: "fa fa-book" - link: https://docs.scala-lang.org/scala3/reference - - title: "Scala 3 Contributing Guide" - description: "Guide to the Scala 3 Compiler and fixing an issue" - icon: "fa fa-cogs" - link: /scala3/guides/contribution/contribution-intro.html - - title: "All new Scaladoc for Scala 3" - description: "Highlights of new features for Scaladoc" - icon: "fa fa-star" - link: /scala3/scaladoc.html - - title: "Talks" - description: "Talks about Scala 3 that can be watched online" - icon: "fa fa-play-circle" - link: /scala3/talks.html - - title: "Online Courses" - description: "Online Courses on Scala 3" - icon: "fa fa-cloud" - link: /online-courses.html ---- diff --git a/scala3/talks.md b/scala3/talks.md index a26eb4034a..d3d110d4d5 100644 --- a/scala3/talks.md +++ b/scala3/talks.md @@ -1,6 +1,8 @@ --- layout: singlepage-overview title: Talks +scala3: true +versionSpecific: true --- Let’s Talk About Scala 3 Series @@ -66,4 +68,3 @@ Deep Dive with Scala 3 Dmitry introduces the call-graph analysis algorithm that Dotty implements and the performance benefits we can get in terms of number of methods, bytecode size, JVM code size and the number of objects allocated in the end. -