diff --git a/.bundle/config b/.bundle/config
deleted file mode 100644
index 9bc01b4c32..0000000000
--- a/.bundle/config
+++ /dev/null
@@ -1,3 +0,0 @@
----
-BUNDLE_PATH: "vendor/bundle"
-BUNDLE_DISABLE_SHARED_GEMS: "true"
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 808f492a7d..e56f07a0ab 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -2,16 +2,16 @@ name: Build
on: [push, pull_request]
jobs:
build:
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
- ruby-version: 2.6.9
+ ruby-version: 3.2.6
bundler-cache: true
- name: Set up coursier
- uses: coursier/setup-action@v1.2.0-M2
+ uses: coursier/setup-action@v1.3.5
with:
jvm: adopt:11
- name: Run mdoc
@@ -25,8 +25,9 @@ jobs:
# # Checking for docs.scala-lang/blob/main leads to a chicken and egg problem because of the edit links of new pages.
bundle exec htmlproofer ./_site/\
--only-4xx\
- --http-status-ignore "400,401,403,429"\
- --empty-alt-ignore\
+ --ignore-status-codes "400,401,403,429"\
+ --ignore-empty-alt\
--allow-hash-href\
- --url-ignore '/https://github.com/scala/docs.scala-lang/blob/main/.*/,/www.oracle.com/'
+ --no-enforce-https\
+ --ignore-urls '/https://github.com/scala/,/www.oracle.com/'
diff --git a/.gitignore b/.gitignore
index e3f650f0b3..055aee462d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,4 @@ vendor/bundle
.idea/
/coursier
.sass-cache/
+.jekyll-cache/
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index 2fe3d70737..b2bbc255f9 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,11 +1,12 @@
-FROM ruby:2.6
+FROM ruby:3.2.6
-RUN gem install bundler jekyll
+RUN gem install bundler:2.6.5
WORKDIR /srv/jekyll
COPY Gemfile .
COPY Gemfile.lock .
+RUN echo -n "bundle version: " && bundle --version
+RUN chmod u+s /bin/chown
RUN bundle install
-
diff --git a/Gemfile b/Gemfile
index 2152cdafa4..31cb37fbea 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,17 +1,6 @@
source 'https://rubygems.org'
-gem 'jekyll-redirect-from'
-gem 'jekyll-scalafiddle'
+gem 'github-pages'
+gem 'webrick'
+#
gem 'html-proofer'
-gem 'kramdown-parser-gfm'
-# gem 'html-proofer' # link-checking: bundle exec htmlproofer ./_site/ --only-4xx --empty-alt-ignore --allow-hash-href
-
-# group :jekyll_plugins do
-# gem 'hawkins'
-# end
-
-# ^ Useful for live reloading the site in your
-# browser during development. To use, uncomment
-# and do:
-# bundle exec jekyll liveserve --incremental
-
-gem "webrick", "~> 1.7"
+# gem 'html-proofer' # link-checking: bundle exec htmlproofer ./_site/ --only-4xx --ignore-empty-alt=true --allow-hash-href=true
diff --git a/Gemfile.lock b/Gemfile.lock
index 5b52d7697a..8088be3873 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,34 +1,146 @@
GEM
remote: https://rubygems.org/
specs:
- addressable (2.8.0)
- public_suffix (>= 2.0.2, < 5.0)
+ Ascii85 (2.0.1)
+ activesupport (8.0.1)
+ base64
+ benchmark (>= 0.3)
+ bigdecimal
+ concurrent-ruby (~> 1.0, >= 1.3.1)
+ connection_pool (>= 2.2.5)
+ drb
+ i18n (>= 1.6, < 2)
+ logger (>= 1.4.2)
+ minitest (>= 5.1)
+ securerandom (>= 0.3)
+ tzinfo (~> 2.0, >= 2.0.5)
+ uri (>= 0.13.1)
+ addressable (2.8.7)
+ public_suffix (>= 2.0.2, < 7.0)
+ afm (0.2.2)
+ async (2.23.0)
+ console (~> 1.29)
+ fiber-annotation
+ io-event (~> 1.9)
+ metrics (~> 0.12)
+ traces (~> 0.15)
+ base64 (0.2.0)
+ benchmark (0.4.0)
+ bigdecimal (3.1.9)
+ coffee-script (2.4.1)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.12.2)
colorator (1.1.0)
- concurrent-ruby (1.1.8)
- em-websocket (0.5.2)
+ commonmarker (0.23.11)
+ concurrent-ruby (1.3.5)
+ connection_pool (2.5.0)
+ console (1.29.3)
+ fiber-annotation
+ fiber-local (~> 1.1)
+ json
+ csv (3.3.2)
+ dnsruby (1.72.3)
+ base64 (~> 0.2.0)
+ simpleidn (~> 0.2.1)
+ drb (2.2.1)
+ em-websocket (0.5.3)
eventmachine (>= 0.12.9)
- http_parser.rb (~> 0.6.0)
- ethon (0.12.0)
- ffi (>= 1.3.0)
+ http_parser.rb (~> 0)
+ ethon (0.16.0)
+ ffi (>= 1.15.0)
eventmachine (1.2.7)
- ffi (1.15.0)
+ execjs (2.10.0)
+ faraday (2.12.2)
+ faraday-net_http (>= 2.0, < 3.5)
+ json
+ logger
+ faraday-net_http (3.4.0)
+ net-http (>= 0.5.0)
+ ffi (1.17.1-arm64-darwin)
+ ffi (1.17.1-x64-mingw-ucrt)
+ ffi (1.17.1-x86_64-linux-gnu)
+ fiber-annotation (0.2.0)
+ fiber-local (1.1.0)
+ fiber-storage
+ fiber-storage (1.0.0)
forwardable-extended (2.6.0)
- html-proofer (3.15.3)
- addressable (~> 2.3)
+ gemoji (4.1.0)
+ github-pages (232)
+ github-pages-health-check (= 1.18.2)
+ jekyll (= 3.10.0)
+ jekyll-avatar (= 0.8.0)
+ jekyll-coffeescript (= 1.2.2)
+ jekyll-commonmark-ghpages (= 0.5.1)
+ jekyll-default-layout (= 0.1.5)
+ jekyll-feed (= 0.17.0)
+ jekyll-gist (= 1.5.0)
+ jekyll-github-metadata (= 2.16.1)
+ jekyll-include-cache (= 0.2.1)
+ jekyll-mentions (= 1.6.0)
+ jekyll-optional-front-matter (= 0.3.2)
+ jekyll-paginate (= 1.1.0)
+ jekyll-readme-index (= 0.3.0)
+ jekyll-redirect-from (= 0.16.0)
+ jekyll-relative-links (= 0.6.1)
+ jekyll-remote-theme (= 0.4.3)
+ jekyll-sass-converter (= 1.5.2)
+ jekyll-seo-tag (= 2.8.0)
+ jekyll-sitemap (= 1.4.0)
+ jekyll-swiss (= 1.0.0)
+ jekyll-theme-architect (= 0.2.0)
+ jekyll-theme-cayman (= 0.2.0)
+ jekyll-theme-dinky (= 0.2.0)
+ jekyll-theme-hacker (= 0.2.0)
+ jekyll-theme-leap-day (= 0.2.0)
+ jekyll-theme-merlot (= 0.2.0)
+ jekyll-theme-midnight (= 0.2.0)
+ jekyll-theme-minimal (= 0.2.0)
+ jekyll-theme-modernist (= 0.2.0)
+ jekyll-theme-primer (= 0.6.0)
+ jekyll-theme-slate (= 0.2.0)
+ jekyll-theme-tactile (= 0.2.0)
+ jekyll-theme-time-machine (= 0.2.0)
+ jekyll-titles-from-headings (= 0.5.3)
+ jemoji (= 0.13.0)
+ kramdown (= 2.4.0)
+ kramdown-parser-gfm (= 1.1.0)
+ liquid (= 4.0.4)
mercenary (~> 0.3)
- nokogumbo (~> 2.0)
- parallel (~> 1.3)
+ minima (= 2.5.1)
+ nokogiri (>= 1.16.2, < 2.0)
+ rouge (= 3.30.0)
+ terminal-table (~> 1.4)
+ webrick (~> 1.8)
+ github-pages-health-check (1.18.2)
+ addressable (~> 2.3)
+ dnsruby (~> 1.60)
+ octokit (>= 4, < 8)
+ public_suffix (>= 3.0, < 6.0)
+ typhoeus (~> 1.3)
+ hashery (2.1.2)
+ html-pipeline (2.14.3)
+ activesupport (>= 2)
+ nokogiri (>= 1.4)
+ html-proofer (5.0.10)
+ addressable (~> 2.3)
+ async (~> 2.1)
+ nokogiri (~> 1.13)
+ pdf-reader (~> 2.11)
rainbow (~> 3.0)
typhoeus (~> 1.3)
yell (~> 2.0)
- http_parser.rb (0.6.0)
- i18n (0.9.5)
+ zeitwerk (~> 2.5)
+ http_parser.rb (0.8.0)
+ i18n (1.14.7)
concurrent-ruby (~> 1.0)
- jekyll (3.9.1)
+ io-event (1.9.0)
+ jekyll (3.10.0)
addressable (~> 2.4)
colorator (~> 1.0)
+ csv (~> 3.0)
em-websocket (~> 0.5)
- i18n (~> 0.7)
+ i18n (>= 0.7, < 2)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 2.0)
kramdown (>= 1.17, < 3)
@@ -37,60 +149,185 @@ GEM
pathutil (~> 0.9)
rouge (>= 1.7, < 4)
safe_yaml (~> 1.0)
+ webrick (>= 1.0)
+ jekyll-avatar (0.8.0)
+ jekyll (>= 3.0, < 5.0)
+ jekyll-coffeescript (1.2.2)
+ coffee-script (~> 2.2)
+ coffee-script-source (~> 1.12)
+ jekyll-commonmark (1.4.0)
+ commonmarker (~> 0.22)
+ jekyll-commonmark-ghpages (0.5.1)
+ commonmarker (>= 0.23.7, < 1.1.0)
+ jekyll (>= 3.9, < 4.0)
+ jekyll-commonmark (~> 1.4.0)
+ rouge (>= 2.0, < 5.0)
+ jekyll-default-layout (0.1.5)
+ jekyll (>= 3.0, < 5.0)
+ jekyll-feed (0.17.0)
+ jekyll (>= 3.7, < 5.0)
+ jekyll-gist (1.5.0)
+ octokit (~> 4.2)
+ jekyll-github-metadata (2.16.1)
+ jekyll (>= 3.4, < 5.0)
+ octokit (>= 4, < 7, != 4.4.0)
+ jekyll-include-cache (0.2.1)
+ jekyll (>= 3.7, < 5.0)
+ jekyll-mentions (1.6.0)
+ html-pipeline (~> 2.3)
+ jekyll (>= 3.7, < 5.0)
+ jekyll-optional-front-matter (0.3.2)
+ jekyll (>= 3.0, < 5.0)
+ jekyll-paginate (1.1.0)
+ jekyll-readme-index (0.3.0)
+ jekyll (>= 3.0, < 5.0)
jekyll-redirect-from (0.16.0)
jekyll (>= 3.3, < 5.0)
+ jekyll-relative-links (0.6.1)
+ jekyll (>= 3.3, < 5.0)
+ jekyll-remote-theme (0.4.3)
+ addressable (~> 2.0)
+ jekyll (>= 3.5, < 5.0)
+ jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0)
+ rubyzip (>= 1.3.0, < 3.0)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
- jekyll-scalafiddle (1.0.1)
- jekyll (~> 3.0)
+ jekyll-seo-tag (2.8.0)
+ jekyll (>= 3.8, < 5.0)
+ jekyll-sitemap (1.4.0)
+ jekyll (>= 3.7, < 5.0)
+ jekyll-swiss (1.0.0)
+ jekyll-theme-architect (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-cayman (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-dinky (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-hacker (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-leap-day (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-merlot (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-midnight (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-minimal (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-modernist (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-primer (0.6.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-github-metadata (~> 2.9)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-slate (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-tactile (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-time-machine (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-titles-from-headings (0.5.3)
+ jekyll (>= 3.3, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
- kramdown (2.3.1)
+ jemoji (0.13.0)
+ gemoji (>= 3, < 5)
+ html-pipeline (~> 2.2)
+ jekyll (>= 3.0, < 5.0)
+ json (2.10.2)
+ kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
- liquid (4.0.3)
- listen (3.5.1)
+ liquid (4.0.4)
+ listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
+ logger (1.6.6)
mercenary (0.3.6)
- mini_portile2 (2.8.0)
- nokogiri (1.13.3)
- mini_portile2 (~> 2.8.0)
+ metrics (0.12.1)
+ minima (2.5.1)
+ jekyll (>= 3.5, < 5.0)
+ jekyll-feed (~> 0.9)
+ jekyll-seo-tag (~> 2.1)
+ minitest (5.25.4)
+ net-http (0.6.0)
+ uri
+ nokogiri (1.18.8-arm64-darwin)
+ racc (~> 1.4)
+ nokogiri (1.18.8-x64-mingw-ucrt)
racc (~> 1.4)
- nokogumbo (2.0.2)
- nokogiri (~> 1.8, >= 1.8.4)
- parallel (1.19.2)
+ nokogiri (1.18.8-x86_64-linux-gnu)
+ racc (~> 1.4)
+ octokit (4.25.1)
+ faraday (>= 1, < 3)
+ sawyer (~> 0.9)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
- public_suffix (4.0.6)
- racc (1.6.0)
- rainbow (3.0.0)
- rb-fsevent (0.11.0)
- rb-inotify (0.10.1)
+ pdf-reader (2.14.1)
+ Ascii85 (>= 1.0, < 3.0, != 2.0.0)
+ afm (~> 0.2.1)
+ hashery (~> 2.0)
+ ruby-rc4
+ ttfunk
+ public_suffix (5.1.1)
+ racc (1.8.1)
+ rainbow (3.1.1)
+ rb-fsevent (0.11.2)
+ rb-inotify (0.11.1)
ffi (~> 1.0)
- rexml (3.2.5)
- rouge (3.26.0)
+ rexml (3.4.1)
+ rouge (3.30.0)
+ ruby-rc4 (0.1.5)
+ rubyzip (2.4.1)
safe_yaml (1.0.5)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
- typhoeus (1.4.0)
+ sawyer (0.9.2)
+ addressable (>= 2.3.5)
+ faraday (>= 0.17.3, < 3)
+ securerandom (0.4.1)
+ simpleidn (0.2.3)
+ terminal-table (1.8.0)
+ unicode-display_width (~> 1.1, >= 1.1.1)
+ traces (0.15.2)
+ ttfunk (1.8.0)
+ bigdecimal (~> 3.1)
+ typhoeus (1.4.1)
ethon (>= 0.9.0)
- webrick (1.7.0)
+ tzinfo (2.0.6)
+ concurrent-ruby (~> 1.0)
+ unicode-display_width (1.8.0)
+ uri (1.0.3)
+ webrick (1.9.1)
yell (2.2.2)
+ zeitwerk (2.7.2)
PLATFORMS
- ruby
+ arm64-darwin-22
+ arm64-darwin-23
+ arm64-darwin-24
+ x64-mingw-ucrt
+ x86_64-linux
DEPENDENCIES
+ github-pages
html-proofer
- jekyll-redirect-from
- jekyll-scalafiddle
- kramdown-parser-gfm
- webrick (~> 1.7)
+ webrick
BUNDLED WITH
- 2.3.6
+ 2.6.5
diff --git a/README.md b/README.md
index fe377e9f6b..013a66267c 100644
--- a/README.md
+++ b/README.md
@@ -1,29 +1,52 @@
# Scala Documentation #
-[](https://platform-ci.scala-lang.org/scala/docs.scala-lang)
+[](https://github.com/scala/docs.scala-lang/actions/workflows/build.yml?query=branch%3Amain)
This repository contains the source for the Scala documentation website, as well as the source for "Scala Improvement Process" (SIP) documents.
+## Dependencies ##
+
+This site uses a Jekyll, a Ruby framework. You'll need Ruby and Bundler installed; see [Jekyll installation instructions](https://jekyllrb.com/docs/installation/) for the details.
+
## Quickstart ##
To build and view the site locally:
- gem install --user-install bundler jekyll
+ bundle install
bundle exec jekyll serve -I
([Trouble on MacOS?](https://github.com/scala/docs.scala-lang/issues/1150))
For more details, read on.
-## Quickstart with Docker ##
+## Quickstart with Docker Compose ##
+
+You need to have [Docker Engine](https://docs.docker.com/engine/) and [Docker Compose](https://docs.docker.com/compose/) installed on your machine.
+Under macOS (Intel or Apple silicon), instead of installing [Docker Desktop](https://docs.docker.com/desktop/) you can also use [HomeBrew](https://brew.sh/) with [Colima](https://github.com/abiosoft/colima): `brew install colima docker docker-compose`.
+UID and GID environment variables are needed to avoid docker from writing files as root in your directory.
+By default, docker-compose will use the file docker-compose.yml which will build the website and serve it on 0.0.0.0:4000 .
+If you just need to build the website, add ```-f docker-compose_build-only.yml```
+
+```
+env UID="$(id -u)" GID="$(id -g)" docker-compose up
+```
-To build and view site with Docker:
+The generated site is available at `http://localhost:4000`.
- docker-compose up
+When the website dependencies change (the content of the `Gemfile`),
+you have to re-build the Docker image:
-It will incrementally build and serve site at `http://localhost:4000`.
+```
+env UID="$(id -u)" GID="$(id -g)" docker-compose up --build
+```
-For more details on the Docker option, see [this issue](https://github.com/scala/docs.scala-lang/issues/1286).
+If you have problems with the Docker image or want to force the rebuild of the Docker image:
+```
+env UID="$(id -u)" GID="$(id -g)" docker-compose build --no-cache
+```
+
+
+For more details on the Docker option, see also [this issue](https://github.com/scala/docs.scala-lang/issues/1286).
## Contributing ##
@@ -34,10 +57,6 @@ Small changes, or corrected typos will generally be pulled in right away. Large
existing documents will be thoroughly reviewed-- please keep in mind that, generally, new documents must be very well-polished, complete, and maintained
in order to be accepted.
-## Dependencies ##
-
-This site uses a Jekyll, a Ruby framework. You'll need Ruby and Bundler installed; see [Jekyll installation instructions](https://jekyllrb.com/docs/installation/) for the details.
-
## Building & Viewing ##
cd into the directory where you cloned this repository, then install the required gems with `bundle install`. This will automatically put the gems into `./vendor/bundle`.
diff --git a/_ba/tour/automatic-closures.md b/_ba/tour/automatic-closures.md
deleted file mode 100644
index 90f751ee2c..0000000000
--- a/_ba/tour/automatic-closures.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-layout: tour
-title: Automatic Type-Dependent Closure Construction
-partof: scala-tour
-
-language: ba
----
diff --git a/_ba/tour/basics.md b/_ba/tour/basics.md
index bff0c133c4..97956e6149 100644
--- a/_ba/tour/basics.md
+++ b/_ba/tour/basics.md
@@ -14,9 +14,9 @@ Na ovoj stranici ćemo objasniti osnove Scale.
## Probavanje Scale u browseru
-Scalu možete probati u Vašem browser sa ScalaFiddle aplikacijom.
+Scalu možete probati u Vašem browser sa Scastie aplikacijom.
-1. Idite na [https://scalafiddle.io](https://scalafiddle.io).
+1. Idite na [Scastie](https://scastie.scala-lang.org/).
2. Zalijepite `println("Hello, world!")` u lijevi panel.
3. Kliknite "Run" dugme. Izlaz će se pojaviti u desnom panelu.
@@ -46,7 +46,7 @@ val x = 1 + 1
println(x) // 2
```
-Imenovani rezultati, kao `x` ovdje, nazivaju se vrijednostima.
+Imenovani rezultati, kao `x` ovdje, nazivaju se vrijednostima.
Referenciranje vrijednosti ne okida njeno ponovno izračunavanje.
Vrijednosti se ne mogu mijenjati.
@@ -61,7 +61,7 @@ Tipovi vrijednosti mogu biti (automatski) zaključeni, ali možete i eksplicitno
val x: Int = 1 + 1
```
-Primijetite da deklaracija tipa `Int` dolazi nakon identifikatora `x`. Također morate dodati i `:`.
+Primijetite da deklaracija tipa `Int` dolazi nakon identifikatora `x`. Također morate dodati i `:`.
### Varijable
@@ -157,7 +157,6 @@ Postoje i neke druge razlike, ali zasad, možete misliti o njima kao nečemu sli
Metode mogu imati višelinijske izraze također.
-{% scalafiddle %}
```scala mdoc
def getSquareString(input: Double): String = {
val square = input * input
@@ -165,7 +164,6 @@ def getSquareString(input: Double): String = {
}
println(getSquareString(2.5)) // 6.25
```
-{% endscalafiddle %}
Zadnjo izraz u tijelu metode je povratna vrijednost metode. (Scala ima ključnu riječ `return`, ali se rijetko koristi.)
@@ -179,9 +177,9 @@ class Greeter(prefix: String, suffix: String) {
println(prefix + name + suffix)
}
```
-Povratni tip metode `greet` je `Unit`, koji kaže da metoda ne vraća ništa značajno.
-Koristi se slično kao `void` u Javi ili C-u.
-(Razlika je u tome što svaki Scalin izraz mora imati neku vrijednost, postoji singlton vrijednost tipa `Unit`, piše se `()`.
+Povratni tip metode `greet` je `Unit`, koji kaže da metoda ne vraća ništa značajno.
+Koristi se slično kao `void` u Javi ili C-u.
+(Razlika je u tome što svaki Scalin izraz mora imati neku vrijednost, postoji singlton vrijednost tipa `Unit`, piše se `()`.
Ne prenosi nikakvu korisnu informaciju.)
Instancu klase možete kreirati pomoću ključne riječi `new`.
@@ -195,7 +193,7 @@ Detaljniji pregled klasa biće dat [kasnije](classes.html).
## Case klase
-Scala ima poseban tip klase koji se zove "case" klasa.
+Scala ima poseban tip klase koji se zove "case" klasa.
Po defaultu, case klase su nepromjenjive i porede se po vrijednosti. Možete ih definisati s `case class` ključnim riječima.
```scala mdoc
@@ -214,15 +212,15 @@ I porede se po vrijednosti.
```scala mdoc
if (point == anotherPoint) {
- println(point + " and " + anotherPoint + " are the same.")
+ println(s"$point and $anotherPoint are the same.")
} else {
- println(point + " and " + anotherPoint + " are different.")
+ println(s"$point and $anotherPoint are different.")
} // Point(1,2) i Point(1,2) su iste.
if (point == yetAnotherPoint) {
- println(point + " and " + yetAnotherPoint + " are the same.")
+ println(s"$point and $yetAnotherPoint are the same.")
} else {
- println(point + " and " + yetAnotherPoint + " are different.")
+ println(s"$point and $yetAnotherPoint are different.")
} // Point(1,2) su Point(2,2) različite.
```
@@ -301,7 +299,7 @@ Trejtove ćemo pokriti u dubinu [kasnije](traits.html).
## Glavna metoda
-Glavna metoda je ulazna tačka programa.
+Glavna metoda je ulazna tačka programa.
Java Virtuelna Mašina traži da se glavna metoda zove `main` i da prima jedan argument, niz stringova.
Koristeći objekt, možete definisati glavnu metodu ovako:
diff --git a/_ba/tour/extractor-objects.md b/_ba/tour/extractor-objects.md
index ac948e255d..0d0618aa00 100644
--- a/_ba/tour/extractor-objects.md
+++ b/_ba/tour/extractor-objects.md
@@ -11,7 +11,7 @@ previous-page: regular-expression-patterns
---
Ekstraktor objekat je objekat koji ima `unapply` metodu.
-Dok je `apply` metoda kao konstruktor koji uzima argumente i kreira objekat, `unapply` metoda prima objekat i pokušava vratiti argumente.
+Dok je `apply` metoda kao konstruktor koji uzima argumente i kreira objekat, `unapply` metoda prima objekat i pokušava vratiti argumente.
Ovo se najčešće koristi u podudaranju uzoraka i parcijalnim funkcijama.
```scala mdoc
@@ -19,7 +19,7 @@ import scala.util.Random
object CustomerID {
- def apply(name: String) = s"$name--${Random.nextLong}"
+ def apply(name: String) = s"$name--${Random.nextLong()}"
def unapply(customerID: String): Option[String] = {
val name = customerID.split("--").head
@@ -34,9 +34,9 @@ customer1ID match {
}
```
-Metoda `apply` kreira `CustomerID` string od argumenta `name`.
-Metoda `unapply` radi suprotno da dobije `name` nazad.
-Kada pozovemo `CustomerID("Sukyoung")`, to je skraćena sintaksa za `CustomerID.apply("Sukyoung")`.
+Metoda `apply` kreira `CustomerID` string od argumenta `name`.
+Metoda `unapply` radi suprotno da dobije `name` nazad.
+Kada pozovemo `CustomerID("Sukyoung")`, to je skraćena sintaksa za `CustomerID.apply("Sukyoung")`.
Kada pozovemo `case CustomerID(name) => customer1ID`, ustvari pozivamo `unapply` metodu.
Metoda `unapply` se može koristiti i za dodjelu vrijednosti.
diff --git a/_ba/tour/higher-order-functions.md b/_ba/tour/higher-order-functions.md
index 8ddead84a5..56f1c1807a 100644
--- a/_ba/tour/higher-order-functions.md
+++ b/_ba/tour/higher-order-functions.md
@@ -21,19 +21,19 @@ def apply(f: Int => String, v: Int) = f(v)
_Napomena: metode se automatski pretvaraju u funkcije ako to kontekst zahtijeva._
Ovo je još jedan primjer:
-
+
```scala mdoc
class Decorator(left: String, right: String) {
def layout[A](x: A) = left + x.toString() + right
}
object FunTest extends App {
- override def apply(f: Int => String, v: Int) = f(v)
+ def apply(f: Int => String, v: Int) = f(v)
val decorator = new Decorator("[", "]")
println(apply(decorator.layout, 7))
}
```
-
+
Izvršavanjem se dobije izlaz:
```
diff --git a/_ba/tour/implicit-conversions.md b/_ba/tour/implicit-conversions.md
index d794590c45..5a1ea3b9fa 100644
--- a/_ba/tour/implicit-conversions.md
+++ b/_ba/tour/implicit-conversions.md
@@ -46,8 +46,8 @@ Možete, zato što `Predef` uključuje slj. implicitnu konverziju:
```scala mdoc
import scala.language.implicitConversions
-implicit def int2Integer(x: Int) =
- java.lang.Integer.valueOf(x)
+implicit def int2Integer(x: Int): Integer =
+ Integer.valueOf(x)
```
Pošto su implicitne konverzije opasne ako se koriste pogrešno, kompajler upozorava kada kompajlira definiciju implicitne konverzije.
diff --git a/_ba/tour/inner-classes.md b/_ba/tour/inner-classes.md
index 10eac53bfb..ef72aa8929 100644
--- a/_ba/tour/inner-classes.md
+++ b/_ba/tour/inner-classes.md
@@ -21,7 +21,7 @@ Radi ilustracije razlike, prikazaćemo implementaciju klase grafa:
class Graph {
class Node {
var connectedNodes: List[Node] = Nil
- def connectTo(node: Node) {
+ def connectTo(node: Node): Unit = {
if (!connectedNodes.exists(node.equals)) {
connectedNodes = node :: connectedNodes
}
@@ -35,7 +35,7 @@ class Graph {
}
}
```
-
+
U našem programu, grafovi su predstavljeni listom čvorova (`List[Node]`).
Svaki čvor ima listu drugih čvorova s kojima je povezan (`connectedNodes`). Klasa `Node` je _path-dependent tip_ jer je ugniježdena u klasi `Graph`. Stoga, svi čvorovi u `connectedNodes` moraju biti kreirani koristeći `newNode` iz iste instance klase `Graph`.
@@ -47,13 +47,13 @@ val node3: graph1.Node = graph1.newNode
node1.connectTo(node2)
node3.connectTo(node1)
```
-
+
Eksplicitno smo deklarisali tip `node1`, `node2`, i `node3` kao `graph1.Node` zbog jasnosti ali ga je kompajler mogao sam zaključiti. Pošto kada pozivamo `graph1.newNode` koja poziva `new Node`, metoda koristi instancu `Node` specifičnu instanci `graph1`.
Da imamo dva grafa, sistem tipova Scale ne dozvoljava miješanje čvorova definisanih u različitim grafovima,
jer čvorovi različitih grafova imaju različit tip.
Ovo je primjer netačnog programa:
-
+
```scala mdoc:fail
val graph1: Graph = new Graph
val node1: graph1.Node = graph1.newNode
@@ -69,12 +69,12 @@ U Javi bi zadnja linija prethodnog primjera bila tačna.
Za čvorove oba grafa, Java bi dodijelila isti tip `Graph.Node`; npr. `Node` bi imala prefiks klase `Graph`.
U Scali takav tip je također moguće izraziti, piše se kao `Graph#Node`.
Ako želimo povezati čvorove različitih grafova, moramo promijeniti definiciju naše inicijalne implementacije grafa:
-
+
```scala mdoc:nest
class Graph {
class Node {
var connectedNodes: List[Graph#Node] = Nil
- def connectTo(node: Graph#Node) {
+ def connectTo(node: Graph#Node): Unit = {
if (!connectedNodes.exists(node.equals)) {
connectedNodes = node :: connectedNodes
}
@@ -88,6 +88,6 @@ class Graph {
}
}
```
-
+
> Primijetite da ovaj program ne dozvoljava da dodamo čvor u dva različita grafa.
Ako bi htjeli ukloniti i ovo ograničenje, moramo promijeniti tipski parametar `nodes` u `Graph#Node`.
diff --git a/_ba/tour/mixin-class-composition.md b/_ba/tour/mixin-class-composition.md
index a38c2ba2e1..a8216abfb6 100644
--- a/_ba/tour/mixin-class-composition.md
+++ b/_ba/tour/mixin-class-composition.md
@@ -29,11 +29,11 @@ val d = new D
d.message // I'm an instance of class B
d.loudMessage // I'M AN INSTANCE OF CLASS B
```
-Klasa `D` je nadklasa od `B` i mixina `C`.
+Klasa `D` je nadklasa od `B` i mixina `C`.
Klase mogu imati samo jednu nadklasu alid mogu imati više mixina (koristeći ključne riječi `extends` i `with` respektivno). Mixini i nadklasa mogu imati isti nadtip.
Pogledajmo sada zanimljiviji primjer počevši od apstraktne klase:
-
+
```scala mdoc
abstract class AbsIterator {
type T
@@ -41,7 +41,7 @@ abstract class AbsIterator {
def next(): T
}
```
-
+
Klasa ima apstraktni tip `T` i standardne metode iteratora.
Dalje, implementiraćemo konkretnu klasu (svi apstraktni članovi `T`, `hasNext`, i `next` imaju implementacije):
@@ -59,9 +59,9 @@ class StringIterator(s: String) extends AbsIterator {
```
`StringIterator` prima `String` i može se koristiti za iteraciju nad `String`om (npr. da vidimo da li sadrži određeni karakter).
-
+
trait RichIterator extends AbsIterator {
- def foreach(f: T => Unit) { while (hasNext) f(next()) }
+ def foreach(f: T => Unit): Unit = { while (hasNext) f(next()) }
}
Kreirajmo sada trejt koji također nasljeđuje `AbsIterator`.
@@ -74,7 +74,7 @@ trait RichIterator extends AbsIterator {
Pošto je `RichIterator` trejt, on ne mora implementirati apstraktne članove `AbsIterator`a.
-Željeli bismo iskombinirati funkcionalnosti `StringIterator`a i `RichIterator`a u jednoj klasi.
+Željeli bismo iskombinirati funkcionalnosti `StringIterator`a i `RichIterator`a u jednoj klasi.
```scala mdoc
object StringIteratorTest extends App {
@@ -83,7 +83,7 @@ object StringIteratorTest extends App {
iter foreach println
}
```
-
+
Nova klasa `Iter` ima `StringIterator` kao nadklasu i `RichIterator` kao mixin.
S jednostrukim nasljeđivanjem ne bismo mogli postići ovaj nivo fleksibilnosti.
diff --git a/_ba/tour/unified-types.md b/_ba/tour/unified-types.md
index c03e54ab0b..92c1e2a61e 100644
--- a/_ba/tour/unified-types.md
+++ b/_ba/tour/unified-types.md
@@ -18,14 +18,14 @@ Dijagram ispod prikazuje hijerarhiju Scala klasa.
## Hijerarhija tipova u Scali ##
-[`Any`](https://www.scala-lang.org/api/2.12.1/scala/Any.html) je nadtip svih tipova, zove se još i vrh-tip.
+[`Any`](https://www.scala-lang.org/api/2.12.1/scala/Any.html) je nadtip svih tipova, zove se još i vrh-tip.
Definiše određene univerzalne metode kao što su `equals`, `hashCode` i `toString`.
`Any` ima dvije direktne podklase, `AnyVal` i `AnyRef`.
-`AnyVal` predstavlja vrijednosne tipove. Postoji devet predefinisanih vrijednosnih tipova i oni ne mogu biti `null`:
+`AnyVal` predstavlja vrijednosne tipove. Postoji devet predefinisanih vrijednosnih tipova i oni ne mogu biti `null`:
`Double`, `Float`, `Long`, `Int`, `Short`, `Byte`, `Char`, `Unit` i `Boolean`.
-`Unit` je vrijednosni tip koji ne nosi značajnu informaciju. Postoji tačno jedna instanca tipa `Unit` koja se piše `()`.
+`Unit` je vrijednosni tip koji ne nosi značajnu informaciju. Postoji tačno jedna instanca tipa `Unit` koja se piše `()`.
Sve funkcije moraju vratiti nešto tako da je `Unit` ponekad koristan povratni tip.
`AnyRef` predstavlja referencne tipove. Svi nevrijednosni tipovi definišu se kao referencni.
@@ -66,7 +66,7 @@ Npr:
```scala mdoc
val x: Long = 987654321
-val y: Float = x // 9.8765434E8 (određena doza preciznosti se gubi ovdje)
+val y: Float = x.toFloat // 9.8765434E8 (određena doza preciznosti se gubi ovdje)
val face: Char = '☺'
val number: Int = face // 9786
@@ -76,17 +76,17 @@ Kastovanje je jednosmjerno. Ovo se ne kompajlira:
```
val x: Long = 987654321
-val y: Float = x // 9.8765434E8
+val y: Float = x.toFloat // 9.8765434E8
val z: Long = y // Does not conform
```
Također možete kastovati i referencni tip u podtip. Ovo će biti pokriveno kasnije.
## Nothing i Null
-`Nothing` je podtip svih tipova, također se zove i donji tip (en. bottom type). Ne postoji vrijednost koja ima tip `Nothing`.
+`Nothing` je podtip svih tipova, također se zove i donji tip (en. bottom type). Ne postoji vrijednost koja ima tip `Nothing`.
Česta upotreba ovog tipa je signalizacija neterminacije kao što je bacanje izuzetka, izlaz iz programa, ili beskonačna petlja (tj. tip izraza koji se ne izračunava u vrijednost, ili metoda koja se ne završava normalno).
-`Null` je podtip svih referencnih tipova (tj. bilo kog podtipa `AnyRef`).
-Ima jednu vrijednost koja se piše literalom `null`.
-`Null` se uglavnom koristi radi interoperabilnosti s ostalim JVM jezicima i skoro nikad se ne koristi u Scala kodu.
+`Null` je podtip svih referencnih tipova (tj. bilo kog podtipa `AnyRef`).
+Ima jednu vrijednost koja se piše literalom `null`.
+`Null` se uglavnom koristi radi interoperabilnosti s ostalim JVM jezicima i skoro nikad se ne koristi u Scala kodu.
Alternative za `null` obradićemo kasnije.
diff --git a/_books/3-scala-for-the-impatient.md b/_books/3-scala-for-the-impatient.md
new file mode 100644
index 0000000000..72c7c01f6d
--- /dev/null
+++ b/_books/3-scala-for-the-impatient.md
@@ -0,0 +1,23 @@
+---
+title: "Scala for the Impatient"
+link: https://horstmann.com/scala/
+image: /resources/img/books/scala_for_the_impatient.jpg
+status: Updated for Scala 3
+authors: ["Cay Horstmann"]
+publisher: Addison-Wesley Professional
+publisherLink: https://www.oreilly.com/publisher/addison-wesley-professional/
+---
+
+What you get:
+
+* Up to date coverage of Scala 3
+* A rapid introduction to Scala for programmers who are competent in another language such as Java, C#, Python, JavaScript, or C++
+* Blog-length chunks of information that you can digest quickly
+* An organization that you'll find useful as a quick reference
+
+What you don't get:
+
+* An introduction into programming or object-oriented design
+* Religion about the superiority of one paradigm or another
+* Cute or academic examples
+* Mind-numbing details about syntax minutiae
diff --git a/_books/3-hands-on-scala.md b/_books/4-hands-on-scala.md
similarity index 100%
rename from _books/3-hands-on-scala.md
rename to _books/4-hands-on-scala.md
diff --git a/_books/5-get-programming.bd b/_books/5-get-programming.md
similarity index 100%
rename from _books/5-get-programming.bd
rename to _books/5-get-programming.md
diff --git a/_books/4-functional-programming-in-scala.md b/_books/7-functional-programming-in-scala.md
similarity index 64%
rename from _books/4-functional-programming-in-scala.md
rename to _books/7-functional-programming-in-scala.md
index 27881827ba..0b878c6b15 100644
--- a/_books/4-functional-programming-in-scala.md
+++ b/_books/7-functional-programming-in-scala.md
@@ -1,15 +1,13 @@
---
title: "Functional Programming in Scala"
-link: https://www.manning.com/books/functional-programming-in-scala
-image: /resources/img/books/FPiS_93x116.png
-status: Covers Scala 2; Scala 3 version in early-access
-authors: ["Paul Chiusano", "Rúnar Bjarnason"]
+link: https://www.manning.com/books/functional-programming-in-scala-second-edition
+image: /resources/img/books/FPiS_93x116.jpg
+status: Updated for Scala 3
+authors: ["Michael Pilquist", "Paul Chiusano", "Rúnar Bjarnason"]
publisher: Manning
publisherLink: https://www.manning.com/
---
"Functional programming (FP) is a style of software development emphasizing functions that don't depend on program state... Functional Programming in Scala is a serious tutorial for programmers looking to learn FP and apply it to the everyday business of coding. The book guides readers from basic techniques to advanced topics in a logical, concise, and clear progression. In it, you'll find concrete examples and exercises that open up the world of functional programming."
-Foreword by Martin Odersky.
-
-The [Scala 3 version](https://www.manning.com/books/functional-programming-in-scala-second-edition), co-authored by Michael Pilquist, is in early-access as of February 2022.
+Forewords by Daniel Spiewak and Martin Odersky.
diff --git a/_cheatsheets/index.md b/_cheatsheets/index.md
index 2b4cc489ec..679e4ed242 100644
--- a/_cheatsheets/index.md
+++ b/_cheatsheets/index.md
@@ -7,7 +7,7 @@ partof: cheatsheet
by: Brendan O'Connor
about: Thanks to Brendan O'Connor, this cheatsheet aims to be a quick reference of Scala syntactic constructions. Licensed by Brendan O'Connor under a CC-BY-SA 3.0 license.
-languages: [ba, fr, ja, pl, pt-br, zh-cn, th, ru]
+languages: [ba, fr, ja, pl, pt-br, zh-cn, th, ru, uk]
---
@@ -220,7 +220,6 @@ languages: [ba, fr, ja, pl, pt-br, zh-cn, th, ru]
import scala.util.control.Breaks._
-
breakable {
for (x <- xs) {
if (Math.random < 0.1)
@@ -332,7 +331,7 @@ breakable {
var y = x
val readonly = 5
private var secret = 1
- def this = this(42)
+ def this() = this(42)
}
Constructor is class body. Declare a public member. Declare a gettable but not settable member. Declare a private member. Alternative constructor.
diff --git a/_config.yml b/_config.yml
index 43f6dfd536..e1ed8d682e 100644
--- a/_config.yml
+++ b/_config.yml
@@ -15,12 +15,11 @@ keywords:
- Document
- Guide
-scala-version: 2.13.8
-scala-212-version: 2.12.15
-scala-3-version: 3.1.1
+scala-version: 2.13.16
+scala-212-version: 2.12.20
+scala-3-version: 3.7.1
collections:
- contribute_resources:
style:
output: true
overviews:
@@ -42,11 +41,6 @@ collections:
permalink: /:collection/:path.html
books:
output: false
- getting-started:
- output: true
- permalink: /:collection/:path.html
- scala3-reference: # not really a collection, but this is the only way I found to be able to generate the navigation bar on the right
- output: true
ja: # Japanese translations
output: true
permalink: /:collection/:path.html
@@ -86,6 +80,9 @@ collections:
th: # Thai translations
output: true
permalink: /:collection/:path.html
+ uk: # Ukrainian translations
+ output: true
+ permalink: /:collection/:path.html
defaults:
-
@@ -94,6 +91,47 @@ defaults:
type: "tour"
values:
overview-name: "Tour of Scala"
+ -
+ scope:
+ path: "_overviews/getting-started"
+ values:
+ permalink: "/:path.html"
+ -
+ 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"
@@ -110,7 +148,7 @@ defaults:
path: "_overviews/contribute"
values:
partof: scala-contribution
- overview-name: Contributing to Scala
+ overview-name: Contributing to Scala's OSS Ecosystem
layout: multipage-overview
permalink: "/contribute/:title.html"
-
@@ -139,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
@@ -148,20 +187,19 @@ defaults:
path: "_overviews/scala3-scaladoc"
values:
scala3: true
+ versionSpecific: true
partof: scala3-scaladoc
overview-name: "Scaladoc"
layout: multipage-overview
permalink: "/scala3/guides/scaladoc/:title.html"
-
scope:
- path: "_scala3-reference"
+ path: "_overviews/toolkit"
values:
- scala3: true
- partof: scala3-reference
- type: section
- overview-name: "Scala 3 Language Reference"
+ partof: toolkit
+ overview-name: "The Scala Toolkit"
layout: multipage-overview
- permalink: "/scala3/reference/:path.html"
+ permalink: "/toolkit/:title.html"
-
scope:
path: "scala3"
@@ -172,8 +210,7 @@ defaults:
highlighter: rouge
permalink: /:categories/:title.html:output_ext
baseurl:
-scala3ref: "/scala3/reference"
-exclude: ["vendor"]
+scala3ref: "https://docs.scala-lang.org/scala3/reference"
+exclude: ["vendor", ".metals"]
plugins:
- jekyll-redirect-from
- - jekyll-scalafiddle
diff --git a/_contribute_resources/1-documentation.md b/_contribute_resources/1-documentation.md
deleted file mode 100644
index e11b539e16..0000000000
--- a/_contribute_resources/1-documentation.md
+++ /dev/null
@@ -1,11 +0,0 @@
----
-title: Documentation
-link: /contribute/documentation.html
-icon: fa fa-book
----
-[Library API docs][scala-standard-library-api-documentation], [new guides][add-guides] on [docs.scala-lang.org][home], and help
-with [scala-lang.org](https://github.com/scala/scala-lang).
-
-[add-guides]: {% link _overviews/contribute/add-guides.md %}
-[scala-standard-library-api-documentation]: {% link _overviews/contribute/scala-standard-library-api-documentation.md %}
-[home]: {% link index.md %}
diff --git a/_contribute_resources/2-bug-fixes.md b/_contribute_resources/2-bug-fixes.md
deleted file mode 100644
index 7026e7e15b..0000000000
--- a/_contribute_resources/2-bug-fixes.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-title: Bug fixes
-link: /contribute/guide.html
-icon: fa fa-bug
----
-Issues with the tools, core libraries and compiler. Also you can help us by [reporting bugs][bug-reporting-guide].
-
-[bug-reporting-guide]: {% link _overviews/contribute/bug-reporting-guide.md %}
diff --git a/_contribute_resources/3-code-reviews.md b/_contribute_resources/3-code-reviews.md
deleted file mode 100644
index e03305beb5..0000000000
--- a/_contribute_resources/3-code-reviews.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-title: Code Reviews
-link: /contribute/codereviews.html
-icon: fa fa-eye
----
-Review pull requests against [scala/scala](https://github.com/scala/scala/pulls),
-[lampepfl/dotty](https://github.com/lampepfl/dotty/pulls),
-[scala/scala-lang](https://github.com/scala/scala-lang/pulls),
-[scala/docs.scala-lang](https://github.com/scala/docs.scala-lang/pulls) and others.
diff --git a/_contribute_resources/4-core-libraries.md b/_contribute_resources/4-core-libraries.md
deleted file mode 100644
index 06f1018479..0000000000
--- a/_contribute_resources/4-core-libraries.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-title: Core Libraries
-link: /contribute/corelibs.html
-icon: fa fa-clipboard
----
-Update and expand the capabilities of the core (and associated) Scala libraries.
diff --git a/_contribute_resources/5-ide-and-build-tools.md b/_contribute_resources/5-ide-and-build-tools.md
deleted file mode 100644
index 7202f0d953..0000000000
--- a/_contribute_resources/5-ide-and-build-tools.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-title: IDE and Build Tools
-link: /contribute/tools.html
-icon: fa fa-terminal
----
-Enhance the Scala tools with features for build tools, IDE plug-ins and other related projects.
diff --git a/_contribute_resources/6-compiler-language.md b/_contribute_resources/6-compiler-language.md
deleted file mode 100644
index d54e34fac9..0000000000
--- a/_contribute_resources/6-compiler-language.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-title: Compiler/Language
-link: /contribute/guide.html#larger-changes-new-features
-icon: fa fa-cogs
----
-Larger language features and compiler enhancements including language specification and SIPs.
diff --git a/_data/compiler-options.yml b/_data/compiler-options.yml
index 0490b25127..f4cced5028 100644
--- a/_data/compiler-options.yml
+++ b/_data/compiler-options.yml
@@ -260,7 +260,7 @@
type: "String"
arg: "release"
default:
- description: "Compile for a specific version of the Java platform. Supported targets: 6, 7, 8, 9"
+ description: "Compile for a specific version of the Java platform. Supported targets: 8, 11, or any higher version listed at https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html"
abbreviations:
- "--release"
- option: "-sourcepath"
@@ -379,8 +379,6 @@
description: "Warn when nullary methods return Unit."
- choice: "inaccessible"
description: "Warn about inaccessible types in method signatures."
- - choice: "nullary-override"
- description: "Warn when non-nullary `def f()` overrides nullary `def f`."
- choice: "infer-any"
description: "Warn when a type argument is inferred to be `Any`."
- choice: "missing-interpolator"
@@ -469,10 +467,6 @@
schema:
type: "Boolean"
description: "Don't perform exhaustivity/unreachability analysis. Also, ignore @switch annotation."
- - option: "-Xno-uescape"
- schema:
- type: "Boolean"
- description: "Disable handling of \\u unicode escapes."
- option: "-Xnojline"
schema:
type: "Boolean"
@@ -1139,8 +1133,6 @@
description: "Warn when nullary methods return Unit."
- choice: "inaccessible"
description: "Warn about inaccessible types in method signatures."
- - choice: "nullary-override"
- description: "Warn when non-nullary `def f()` overrides nullary `def f`."
- choice: "infer-any"
description: "Warn when a type argument is inferred to be `Any`."
- choice: "missing-interpolator"
diff --git a/_data/doc-nav-header.yml b/_data/doc-nav-header.yml
index 52b66be1da..772da79703 100644
--- a/_data/doc-nav-header.yml
+++ b/_data/doc-nav-header.yml
@@ -1,16 +1,32 @@
- title: Getting Started
- url: "/getting-started/index.html"
+ url: "#"
+ submenu:
+ - title: Install Scala
+ url: "/getting-started/install-scala.html"
+ - title: Scala IDEs
+ url: "/getting-started/scala-ides.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"
- - title: Online Resources
- url: "/learn.html"
+- title: Scala 3 Migration
+ 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: Tutorials
url: "#"
submenu:
@@ -24,6 +40,8 @@
url: "/tutorials/scala-on-android.html"
- title: Scala with Maven
url: "/tutorials/scala-with-maven.html"
+ - title: Using the Scala Toolkit
+ url: "/toolkit/introduction.html"
- title: Reference
url: "#"
submenu:
@@ -33,9 +51,13 @@
url: "/books.html"
- title: Scala FAQ
url: "/tutorials/FAQ/index.html"
- - title: Language Specification
+ - title: Scala 2 Language Specification
url: http://scala-lang.org/files/archive/spec/2.13/
- - title: Contribution Guide
+ - title: Scala 3 Language Specification
+ url: http://scala-lang.org/files/archive/spec/3.4/
+ - title: Scala 3 Language Reference
+ url: "https://docs.scala-lang.org/scala3/reference"
+ - title: Scala Contribution Guide
url: "/contribute/"
- title: Style Guide
url: "/style/index.html"
@@ -44,11 +66,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/footer.yml b/_data/footer.yml
index b810181f92..789017f8b9 100644
--- a/_data/footer.yml
+++ b/_data/footer.yml
@@ -21,9 +21,11 @@
links:
- title: Community
url: "http://scala-lang.org/community/"
- - title: Mailing Lists
- url: "http://scala-lang.org/community/index.html#mailing-lists"
- - title: Chat Rooms & More
+ - title: Scala Ambassadors
+ url: "http://scala-lang.org/ambassadors/"
+ - title: Forums
+ url: "http://scala-lang.org/community/index.html#forums"
+ - title: Chat
url: "http://scala-lang.org/community/index.html#chat-rooms"
- title: Libraries and Tools
url: "http://scala-lang.org/community/index.html#community-libraries-and-tools"
@@ -39,16 +41,28 @@
- title: Scala
class: scala
links:
+ - title: Governance
+ url: "http://scala-lang.org/governance/"
- title: Blog
url: "http://scala-lang.org/blog/"
- title: Code of Conduct
url: "http://scala-lang.org/conduct/"
- title: License
url: "http://scala-lang.org/license/"
+ - title: Security Policy
+ url: "http://scala-lang.org/security/"
- title: Social
class: social
links:
- title: GitHub
url: "https://github.com/scala/scala"
- - title: Twitter
- url: "https://twitter.com/scala_lang"
+ - title: Mastodon
+ url: "https://fosstodon.org/@scala_lang"
+ - title: Bluesky
+ url: "https://bsky.app/profile/scala-lang.org"
+ - title: X
+ url: "https://x.com/scala_lang"
+ - title: Discord
+ url: "https://discord.com/invite/scala"
+ - title: LinkedIn
+ url: "https://www.linkedin.com/company/scala-center/"
\ No newline at end of file
diff --git a/_data/messages.yml b/_data/messages.yml
new file mode 100644
index 0000000000..642a7ac557
--- /dev/null
+++ b/_data/messages.yml
@@ -0,0 +1 @@
+scam-banner: "**⚠️ Beware of Scams**: since Feb 2024, scammers are using [fake Scala websites to sell courses](https://www.scala-lang.org/blog/2024/03/01/fake-scala-courses.html), please check you are using an official source."
diff --git a/_data/nav-header.yml b/_data/nav-header.yml
index eeaa88291c..792c68fc1e 100644
--- a/_data/nav-header.yml
+++ b/_data/nav-header.yml
@@ -8,5 +8,7 @@
url: https://index.scala-lang.org
- title: Community
url: https://www.scala-lang.org/community/
+- title: Governance
+ url: https://www.scala-lang.org/governance/
- title: Blog
url: https://www.scala-lang.org/blog/
diff --git a/_data/overviews-ja.yml b/_data/overviews-ja.yml
index 13be915210..60277bd90c 100644
--- a/_data/overviews-ja.yml
+++ b/_data/overviews-ja.yml
@@ -58,6 +58,30 @@
- category: 言語
description: "Scala 言語の機能をカバーするガイドと概要"
overviews:
+ - title: "Scala 2 から Scala 3 への移行"
+ icon: suitcase
+ root: "scala3/guides/"
+ url: "migration/compatibility-intro.html"
+ description: "Scala 3 との互換性と移行について知っておくべきことすべて"
+ - title: "Scala 3 マクロ"
+ by: Nicolas Stucki
+ icon: magic
+ root: "scala3/guides/"
+ url: "macros"
+ description: "Scala 3 のマクロの書き方に関係する全ての機能をカバーする詳しいチュートリアル"
+ label-text: new in Scala 3
+ - title: 値クラスと汎用トレイト
+ by: Mark Harrah
+ description: "値クラスは Scala で実行時のオブジェクトアロケーションを避ける新しい仕組みだ。これは新しい AnyVal サブクラスを定義することで達成できる。"
+ icon: gem
+ url: "core/value-classes.html"
+ - title: TASTyの概要
+ by: Alvin Alexander
+ icon: birthday-cake
+ root: "scala3/guides/"
+ url: "tasty-overview.html"
+ description: "Scala のエンドユーザー向けの TASTy のフォーマットの概要"
+ label-text: new in Scala 3
- title: 文字列補間
icon: dollar-sign
url: "core/string-interpolation.html"
@@ -70,11 +94,6 @@
by: Josh Suereth
description: "Scala 2.10 は暗黙クラス(implicit class)と呼ばれる新しい機能を導入した。暗黙クラスは implicit キーワードでマークされたクラスだ。このキーワードはそのクラスがスコープ内にあるとき、そのプライマリコンストラクターが暗黙変換に利用可能にする。"
url: "core/implicit-classes.html"
- - title: 値クラスと汎用トレイト
- by: Mark Harrah
- description: "値クラスは Scala で実行時のオブジェクトアロケーションを避ける新しい仕組みだ。これは新しい AnyVal サブクラスを定義することで達成できる。"
- icon: gem
- url: "core/value-classes.html"
- category: ライブラリの作成
description: "Scala エコシステム向けのオープンソースライブラリの貢献方法のガイド"
@@ -258,18 +277,6 @@
- category: レガシー
description: "最近の Scala バージョン(2.12以上)には関係なくなった機能をカバーするガイド。"
overviews:
- - title: Scala アクター移行ガイド
- by: Vojin Jovanovic and Philipp Haller
- icon: truck
- url: "core/actors-migration-guide.html"
- description: "Scala アクターから Akka への移行を容易にするため、Actor Migration Kit(AMK)を用意した。AMK は、Scala アクターの拡張から構成され、プロジェクトのクラスパスに scala-actors-migration.jar を含めることで有効になる。加えて、Akka 2.1 はアクター DSL シングルトンのような機能を導入し、Scala アクターを使ったコードを Akka へ容易に変換することを可能にしている。このドキュメントの目的はユーザーに移行プロセスを案内し、AMK の使い方を説明することだ。"
- - title: Scala アクター API
- by: Philipp Haller and Stephen Tu
- icon: users
- url: "core/actors.html"
- description: "このガイドは Scala 2.8/2.9 の scala.actors パッケージの API を説明する。組織は論理的に同類の型のグループに従う。トレイト階層は個々のセクションを構造化することを考慮している。既存の Scaladoc ベースの API ドキュメントを補間するため、これらトレイトが定義する様々なメソッドの実行時の挙動にフォーカスする。"
- label-color: "#899295"
- label-text: deprecated
- title: Scala 2.8 から 2.12 までのコレクション
by: Martin Odersky
icon: sitemap
diff --git a/_data/overviews-ru.yml b/_data/overviews-ru.yml
index 8fdadb53e5..f4a652a032 100644
--- a/_data/overviews-ru.yml
+++ b/_data/overviews-ru.yml
@@ -258,18 +258,6 @@
- category: Наследие
description: "Руководство по функционалу, которые больше не соответствуют последним версиям Scala (2.12+)."
overviews:
- - title: Руководство по миграции Scala Акторов
- by: Vojin Jovanovic и Philipp Haller
- icon: truck
- url: "core/actors-migration-guide.html"
- description: "Для облегчения миграции со Скала Актеров на Акка мы предоставили Миграционный Комплект для Актеров (МКА). МКА состоит из расширения Scala Акторов, которое позволяет включить scala-actors-migration.jar в пространство классов проекта. Кроме того, Akka 2.1 включает в себя такие функции, как ActorDSL singleton, которые позволяют осуществлять простое преобразование кода с использованием Scala Actors в Akka. Цель этого документа - помочь пользователям пройти через процесс миграции и объяснить, как использовать МКА."
- - title: API Scala Акторов
- by: Philipp Haller и Stephen Tu
- icon: users
- url: "core/actors.html"
- description: "В данном руководстве описывается API пакета scala.actors версии 2.8/2.9. Сгруппированы по типам, которые логически принадлежат друг другу. Иерархия трейтов учитывается при структурировании отдельных разделов. Основное внимание уделяется поведению во время исполнения различных методов, которое дополняет существующую документацию по API на основе Scaladoc."
- label-color: "#899295"
- label-text: устарело
- title: Scala коллекции с 2.8 по 2.12
by: Martin Odersky
icon: sitemap
diff --git a/_data/overviews-uk.yml b/_data/overviews-uk.yml
new file mode 100644
index 0000000000..02be500922
--- /dev/null
+++ b/_data/overviews-uk.yml
@@ -0,0 +1,348 @@
+- category: Стандартна бібліотека
+ description: "Посібники та огляди стандартної бібліотеки Scala."
+ overviews:
+ - title: Scala колекції
+ by: Martin Odersky та Julien Richard-Foy
+ icon: sitemap
+ url: "collections-2.13/introduction.html"
+ description: "Бібліотека колекцій Scala."
+ subdocs:
+ - title: Вступ
+ url: "collections-2.13/introduction.html"
+ - title: Змінювані та незмінювані колекції
+ url: "collections-2.13/overview.html"
+ - title: Трейт Iterable
+ url: "collections-2.13/trait-iterable.html"
+ - title: Трейти послідовностей. Seq, IndexedSeq та LinearSeq
+ url: "collections-2.13/seqs.html"
+ - title: Реалізація незмінюваних колекцій
+ url: "collections-2.13/concrete-immutable-collection-classes.html"
+ - title: Реалізація змінюваних колекцій
+ url: "collections-2.13/concrete-mutable-collection-classes.html"
+ - title: Масиви
+ url: "collections-2.13/arrays.html"
+ - title: Рядки
+ url: "collections-2.13/strings.html"
+ - title: Показники продуктивності
+ url: "collections-2.13/performance-characteristics.html"
+ - title: Рівність
+ url: "collections-2.13/equality.html"
+ - title: Відображення
+ url: "collections-2.13/views.html"
+ - title: Ітератори
+ url: "collections-2.13/iterators.html"
+ - title: Створення колекцій з нуля
+ url: "collections-2.13/creating-collections-from-scratch.html"
+ - title: Перетворення між колекціями Java та Scala
+ url: "collections-2.13/conversions-between-java-and-scala-collections.html"
+ - title: Міграція проєкту до колекцій Scala 2.13
+ icon: sitemap
+ url: "core/collections-migration-213.html"
+ description: "Ця сторінка описує основні зміни в колекціях для користувачів, які переходять на Scala 2.13. Також, розглянуто варіанти побудови проєкти з перехресною сумісністю для Scala 2.11/2.12 і 2.13."
+ - title: Архітектура колекцій Scala
+ icon: sitemap
+ url: "core/architecture-of-scala-213-collections.html"
+ by: Julien Richard-Foy
+ description: "Ці сторінки описують архітектуру фреймворку колекцій, представленого в Scala 2.13. У порівнянні з Collections API ви дізнаєтеся більше про внутрішню роботу фреймворка."
+ - title: Реалізація користувацьких колекцій
+ icon: building
+ url: "core/custom-collections.html"
+ by: Martin Odersky, Lex Spoon та Julien Richard-Foy
+ description: "У цьому документі ви дізнаєтеся, як фреймворк колекцій допомагає вам визначати власні колекції за допомогою кількох рядків коду, повторно використовуючи переважну частину функцій колекції з фреймворку."
+ - title: Додавання спеціальних операцій до колекцій
+ icon: building
+ url: "core/custom-collection-operations.html"
+ by: Julien Richard-Foy
+ description: "У цьому посібнику показано, як писати перетворення, що застосовуються до всіх типів колекцій і повертати той самий тип колекції. Також, як писати операції, які параметризуються типом колекції."
+
+- category: Мова
+ description: "Посібники та огляди, що охоплюють функції на мові Scala."
+ overviews:
+ - title: Міграція зі Scala 2 на Scala 3
+ by: Adrien Piquerez
+ icon: suitcase
+ root: "scala3/guides/"
+ url: "migration/compatibility-intro.html"
+ description: "Все, що потрібно знати про сумісність і міграцію на Scala 3."
+ - title: Макроси Scala 3
+ by: Nicolas Stucki
+ icon: magic
+ root: "scala3/guides/"
+ url: "macros"
+ description: "Детальний підручник, який охоплює всі можливості, пов'язані з написанням макросів у Scala 3."
+ label-text: нове в Scala 3
+ - title: Класи значень та універсальні трейти
+ by: Mark Harrah
+ description: "Класи значень – це новий механізм у Scala, що дозволяє уникнути виділення об'єктів під час виконання. Це досягається за допомогою визначення нових підкласів AnyVal."
+ icon: gem
+ url: "core/value-classes.html"
+ - title: Огляд TASTy
+ by: Alvin Alexander
+ icon: birthday-cake
+ label-text: нове в Scala 3
+ root: "scala3/guides/"
+ url: "tasty-overview.html"
+ description: "Огляд формату TASTy, призначеного для користувачів мови Scala."
+ - title: Інтерполяція рядків
+ icon: dollar-sign
+ url: "core/string-interpolation.html"
+ description: >
+ Інтерполяція рядків дозволяє користувачам вбудовувати посилання на змінні безпосередньо в оброблені рядкові літерали. Ось приклад:
+
val name = "James"
+ println(s"Hello, $name") // Hello, James
+ Літерал s"Hello, $name" є рядковим літералом, який буде додатково оброблено. Це означає, що компілятор виконує додаткову роботу над цим літералом. Оброблений рядковий літерал позначається набором символів, що передують ". Інтерполяція рядків була введена в SIP-11.
+ - title: Неявні класи
+ by: Josh Suereth
+ description: "Scala 2.10 представила нову функцію під назвою неявні класи. Неявний клас — це клас, позначений ключовим словом implicit. Це ключове слово робить основний конструктор класу доступним для неявних перетворень, коли клас знаходиться в області видимості."
+ url: "core/implicit-classes.html"
+
+- category: Створення бібліотек
+ description: "Посібники щодо розробки бібліотек з відкритим кодом для екосистеми Scala."
+ overviews:
+ - title: Посібник для авторів бібліотек
+ by: Julien Richard-Foy
+ icon: tasks
+ url: "contributors/index.html"
+ description: "Перелічує всі інструменти, які автори бібліотек мають налаштувати для публікації та документування своїх бібліотек."
+
+- category: Паралельне та конкурентне програмування
+ description: "Повні посібники, що охоплюють деякі бібліотеки Scala для паралельного та конкурентного програмування."
+ overviews:
+ - title: Future та Promise
+ by: Philipp Haller, Aleksandar Prokopec, Heather Miller, Viktor Klang, Roland Kuhn та Vojin Jovanovic
+ icon: tasks
+ url: "core/futures.html"
+ description: "Ф'ючери дають можливість міркувати про паралельне виконання багатьох операцій – ефективним і не блокуючим способом. Ф'ючер — це об’єкт-заповнювач для значення, яке може ще не існувати. Як правило, вартість Ф'ючеру надається одночасно і може згодом використовуватися. Складання одночасних завдань таким чином, як правило, призводить до швидшого, асинхронного, не блокувального паралельного коду."
+ - title: Паралельні колекції
+ by: Aleksandar Prokopec та Heather Miller
+ icon: rocket
+ url: "parallel-collections/overview.html"
+ description: "Бібліотека паралельних колекцій Scala."
+ subdocs:
+ - title: Огляд
+ url: "parallel-collections/overview.html"
+ - title: Реалізація паралельних колекцій
+ url: "parallel-collections/concrete-parallel-collections.html"
+ - title: Перетворення паралельних колекцій
+ url: "parallel-collections/conversions.html"
+ - title: Конкурентні Try
+ url: "parallel-collections/ctries.html"
+ - title: Архітектура бібліотеки паралельних колекцій
+ url: "parallel-collections/architecture.html"
+ - title: Створення користувацьких паралельних колекцій
+ url: "parallel-collections/custom-parallel-collections.html"
+ - title: Конфігурація паралельних колекцій
+ url: "parallel-collections/configuration.html"
+ - title: Вимірювання продуктивності
+ url: "parallel-collections/performance.html"
+
+- category: Сумісність
+ description: "Що з чим працює (чи ні)."
+ overviews:
+ - title: Сумісність версій JDK
+ description: "Які версії Scala працюють на яких версіях JDK"
+ icon: coffee
+ url: "jdk-compatibility/overview.html"
+ - title: Бінарна сумісність релізів Scala
+ description: "Якщо дві версії Scala бінарно сумісні, можна безпечно скомпілювати свій проєкт на одній версії Scala та зв'язати з іншою версією Scala під час виконання. Безпечне зв'язування під час виконання (тільки!) означає, що JVM не генерує (підклас) LinkageError під час виконання вашої програми у змішаному сценарії, припускаючи, що вона не виникає при компіляції та запуску в одній версії Scala. Конкретно це означає, що ви можете мати зовнішні залежності від вашого шляху до класу під час виконання, які використовують іншу версію Scala, ніж та, з якою ви компілюєте, за умови, що вони сумісні з бінарними файлами. Іншими словами, окрема компіляція в різних версіях, сумісних з бінарними файлами, не створює проблем у порівнянні з компіляцією та запуском всього в одній версії Scala."
+ icon: puzzle-piece
+ url: "core/binary-compatibility-of-scala-releases.html"
+ - title: Бінарна сумісність для авторів бібліотек
+ description: "Різноманітний і повний набір бібліотек важливий для будь-якої продуктивної екосистеми програмного забезпечення. Хоча розробляти та розповсюджувати бібліотеки Scala легко, добре авторство бібліотеки виходить за рамки простого написання коду та його публікації. У цьому посібнику ми розглянемо важливу тему бінарної сумісності."
+ icon: puzzle-piece
+ url: "core/binary-compatibility-for-library-authors.html"
+
+- category: Інструменти
+ description: "Довідковий матеріал про основні інструменти Scala, такі як покоління Scala REPL і Scaladoc."
+ overviews:
+ - title: Scala 2 REPL
+ icon: terminal
+ url: "repl/overview.html"
+ description: |
+ Scala REPL це інструмент (scala) для виконання виразів в Scala.
+
+ Команда scala виконає скрипт шляхом обгортання його в шаблон, а потім компіляції та виконання отриманої програми
+ - title: Scaladoc для Scala 3
+ by: Krzysztof Romanowski, Aleksander Boruch-Gruszecki, Andrzej Ratajczak, Kacper Korban, Filip Zybała
+ icon: book
+ root: "scala3/guides/"
+ url: "scaladoc"
+ label-text: оновлено
+ description: "Оновлення в Scala 3 для інструменту генерації документації API."
+ - title: Scaladoc
+ url: "scaladoc/overview.html"
+ icon: book
+ description: "Інструмент Scala для генерації документації для API."
+ subdocs:
+ - title: Огляд
+ url: "scaladoc/overview.html"
+ - title: Scaladoc для авторів бібліотек
+ url: "scaladoc/for-library-authors.html"
+ - title: Використання інтерфейсу Scaladoc
+ url: "scaladoc/interface.html"
+
+- category: Компілятор
+ description: "Посібники та огляди компілятора Scala: плагіни компілятора, інструменти рефлексії та метапрограмування, такі як макроси."
+ overviews:
+ - title: "Посібник з внесення змін у Scala 3"
+ by: Jamie Thompson, Anatolii Kmetiuk
+ icon: cogs
+ root: "scala3/guides/"
+ url: "contribution/contribution-intro.html"
+ description: "Посібник з компілятора Scala 3 та вирішення проблем."
+ - title: Рефлексія в Scala 2
+ by: Heather Miller, Eugene Burmako та Philipp Haller
+ icon: binoculars
+ url: "reflection/overview.html"
+ description: Фреймворк Scala для рефлексії під час виконання/компіляції.
+ label-text: відсутнє в Scala 3
+ subdocs:
+ - title: Огляд
+ url: "reflection/overview.html"
+ - title: Environment, Universe та Mirror
+ url: "reflection/environment-universes-mirrors.html"
+ - title: Symbol, Tree та Type
+ url: "reflection/symbols-trees-types.html"
+ - title: Annotation, Name, Scope та More
+ url: "reflection/annotations-names-scopes.html"
+ - title: TypeTag та Manifest
+ url: "reflection/typetags-manifests.html"
+ - title: Безпека потоків
+ url: "reflection/thread-safety.html"
+ - title: Зміни в Scala 2.11
+ url: "reflection/changelog211.html"
+ - title: Макроси в Scala 2
+ by: Eugene Burmako
+ icon: magic
+ url: "macros/usecases.html"
+ description: "Фреймворк метапрограмування Scala."
+ label-text: відсутнє в Scala 3
+ subdocs:
+ - title: Випадки використання
+ url: "macros/usecases.html"
+ - title: Blackbox проти Whitebox
+ url: "macros/blackbox-whitebox.html"
+ - title: Макроси Def
+ url: "macros/overview.html"
+ - title: Квазіцитати
+ url: "quasiquotes/intro.html"
+ - title: Пакети макросів
+ url: "macros/bundles.html"
+ - title: Неявні макроси
+ url: "macros/implicits.html"
+ - title: Макроси-екстрактори
+ url: "macros/extractors.html"
+ - title: Провайдери типів
+ url: "macros/typeproviders.html"
+ - title: Анотації макросів
+ url: "macros/annotations.html"
+ - title: Макрос Paradise
+ url: "macros/paradise.html"
+ - title: Дорожня карта
+ url: "macros/roadmap.html"
+ - title: Зміни в 2.11
+ url: "macros/changelog211.html"
+ - title: Квазіцитати в Scala 2
+ by: Denys Shabalin
+ icon: quote-left
+ url: "quasiquotes/setup.html"
+ description: "Квазіцитати — це зручний спосіб маніпулювати синтаксичними деревами Scala."
+ label-text: відсутнє в Scala 3
+ subdocs:
+ - title: Залежності та налаштування
+ url: "quasiquotes/setup.html"
+ - title: Вступ
+ url: "quasiquotes/intro.html"
+ - title: Підіймання
+ url: "quasiquotes/lifting.html"
+ - title: Опускання
+ url: "quasiquotes/unlifting.html"
+ - title: Гігієна
+ url: "quasiquotes/hygiene.html"
+ - title: Випадки використання
+ url: "quasiquotes/usecases.html"
+ - title: Резюме синтаксису
+ url: "quasiquotes/syntax-summary.html"
+ - title: Деталі виразів
+ url: "quasiquotes/expression-details.html"
+ - title: Деталі типів
+ url: "quasiquotes/type-details.html"
+ - title: Деталі патернів
+ url: "quasiquotes/pattern-details.html"
+ - title: Деталі визначення та імпорту
+ url: "quasiquotes/definition-details.html"
+ - title: Резюме термінології
+ url: "quasiquotes/terminology.html"
+ - title: Майбутні перспективи
+ url: "quasiquotes/future.html"
+ - title: Плагіни компілятора
+ by: Lex Spoon та Seth Tisue
+ icon: puzzle-piece
+ url: "plugins/index.html"
+ description: "Плагіни компілятора дозволяють налаштовувати та розширювати компілятор Scala. У цьому підручнику описується функція плагіну та пояснюється, як створити простий плагін."
+ - title: Параметри компілятора
+ by: Community
+ icon: cog
+ url: "compiler-options/index.html"
+ description: "Різні параметри того як scalac компілює ваш код."
+ - title: Форматування помилок
+ by: Torsten Schmits
+ icon: cog
+ url: "compiler-options/errors.html"
+ description: "Новий механізм для більш зручних повідомлень про помилки, друку ланцюжків залежних неявних параметрів та кольорових відмінностей знайдених/потрібних типів."
+ - title: Оптимізатор
+ by: Lukas Rytz та Andrew Marki
+ icon: cog
+ url: "compiler-options/optimizer.html"
+ description: "Компілятор може виконувати різні оптимізації."
+
+- category: Спадщина (legacy)
+ description: "Посібники, що охоплюють функції, які більше не стосуються останніх версій Scala (2.12+)."
+ overviews:
+ - title: Колекції Scala з 2.8 до 2.12
+ by: Martin Odersky
+ icon: sitemap
+ url: "collections/introduction.html"
+ description: "Бібліотека колекцій Scala."
+ subdocs:
+ - title: Вступ
+ url: "collections/introduction.html"
+ - title: Змінювані та незмінювані колекції
+ url: "collections/overview.html"
+ - title: Трейт Traversable
+ url: "collections/trait-traversable.html"
+ - title: Трейт Iterable
+ url: "collections/trait-iterable.html"
+ - title: Трейти послідовностей. Seq, IndexedSeq та LinearSeq
+ url: "collections/seqs.html"
+ - title: Множини
+ url: "collections/sets.html"
+ - title: Асоціативні масиви
+ url: "collections/maps.html"
+ - title: Реалізація незмінюваних колекцій
+ url: "collections/concrete-immutable-collection-classes.html"
+ - title: Реалізація змінюваних колекцій
+ url: "collections/concrete-mutable-collection-classes.html"
+ - title: Масиви
+ url: "collections/arrays.html"
+ - title: Рядки
+ url: "collections/strings.html"
+ - title: Показники продуктивності
+ url: "collections/performance-characteristics.html"
+ - title: Рівність
+ url: "collections/equality.html"
+ - title: Відображення
+ url: "collections/views.html"
+ - title: Ітератори
+ url: "collections/iterators.html"
+ - title: Створення колекцій з нуля
+ url: "collections/creating-collections-from-scratch.html"
+ - title: Перетворення між колекціями Java та Scala
+ url: "collections/conversions-between-java-and-scala-collections.html"
+ - title: Міграція з версії Scala 2.7
+ url: "collections/migrating-from-scala-27.html"
+ - title: Архітектура колекцій Scala з 2.8 до 2.12
+ icon: building
+ url: "core/architecture-of-scala-collections.html"
+ by: Martin Odersky та Lex Spoon
+ description: "На цих сторінках детально описується архітектура фреймворку колекцій Scala. У порівнянні з Collections API ви дізнаєтеся більше про внутрішню роботу фреймворку. Ви також дізнаєтеся, як ця архітектура допомагає вам визначати власні колекції за допомогою кількох рядків коду, повторно використовуючи переважну частину функцій колекції з фреймворку."
diff --git a/_data/overviews-zh-cn.yml b/_data/overviews-zh-cn.yml
index d264b4e5d1..1c48218eef 100644
--- a/_data/overviews-zh-cn.yml
+++ b/_data/overviews-zh-cn.yml
@@ -263,18 +263,6 @@
- category: 遗留问题
description: "涵盖一些与最近的 Scala 版本(2.12+)不再相关的特性的参考"
overviews:
- - title: Scala Actors迁移参考
- by: Vojin Jovanovic and Philipp Haller
- icon: truck
- url: "core/actors-migration-guide.html"
- description: "为简化 Scala Actors 到 Akka 的迁移我们提供了 Actor 迁移包(Actor Migration Kit,简称 AMK)。迁移包中包含了 Scala Actors 的一个扩展,可以通过项目类路径中包含 scala-actors-migration.jar 来引入该扩展。另外,Akka 2.1 还包含一些新特性,比如 ActorDSL 单例,可使用 Scala Actors 编写的代码更易转换成 Akka 的。本篇目的是指导用户迁移过程并阐释如何使用 Actor 迁移包。"
- - title: Scala Actors API
- by: Philipp Haller and Stephen Tu
- icon: users
- url: "core/actors.html"
- description: "本篇描述了 Scala 2.8/2.9 下 scala.actors 包的 API。其组织方式遵循逻辑上属于一块的组类型,特质层是考虑到组成其各自的部分,主要关注点在这些特质所定义的各种方法的运行时表现,由此也增补了已有的基于 Scaladoc 的API文档。"
- label-color: "#899295"
- label-text: 弃用
- title: Scala 2.8 到 2.12 的容器
by: Martin Odersky
icon: sitemap
diff --git a/_data/overviews.yml b/_data/overviews.yml
index a8bc055f7c..5756db5e3e 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."
@@ -133,17 +161,27 @@
description: "A diverse and comprehensive set of libraries is important to any productive software ecosystem. While it is easy to develop and distribute Scala libraries, good library authorship goes beyond just writing code and publishing it. In this guide, we cover the important topic of Binary Compatibility."
icon: puzzle-piece
url: "core/binary-compatibility-for-library-authors.html"
+ - title: Nightly Versions of Scala
+ description: "We regularly publish 'nightlies' of both Scala 3 and Scala 2 so that users can preview and test the contents of upcoming releases. Here's how to find and use these versions."
+ url: "core/nightlies.html"
- 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 +197,12 @@
- category: Compiler
description: "Guides and overviews covering the Scala compiler: compiler plugins, reflection, and metaprogramming tools such as macros."
overviews:
- - title: Reflection
+ - 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 +218,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 +249,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 +282,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,22 +303,9 @@
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:
- - title: The Scala Actors Migration Guide
- by: Vojin Jovanovic and Philipp Haller
- icon: truck
- url: "core/actors-migration-guide.html"
- description: "To ease the migration from Scala Actors to Akka we have provided the Actor Migration Kit (AMK). The AMK consists of an extension to Scala Actors which is enabled by including the scala-actors-migration.jar on a project’s classpath. In addition, Akka 2.1 includes features, such as the ActorDSL singleton, which enable a simpler conversion of code using Scala Actors to Akka. The purpose of this document is to guide users through the migration process and explain how to use the AMK."
- - title: The Scala Actors API
- by: Philipp Haller and Stephen Tu
- icon: users
- url: "core/actors.html"
- description: "This guide describes the API of the scala.actors package of Scala 2.8/2.9. The organization follows groups of types that logically belong together. The trait hierarchy is taken into account to structure the individual sections. The focus is on the run-time behavior of the various methods that these traits define, thereby complementing the existing Scaladoc-based API documentation."
- label-color: "#899295"
- label-text: deprecated
- title: Scala 2.8 to 2.12’s Collections
by: Martin Odersky
icon: sitemap
diff --git a/_data/scala3-doc-nav-header.yml b/_data/scala3-doc-nav-header.yml
deleted file mode 100644
index 4b2201d17f..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: "/scala3/reference/overview.html"
- - 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/_data/setup-scala.yml b/_data/setup-scala.yml
new file mode 100644
index 0000000000..cda4c2361b
--- /dev/null
+++ b/_data/setup-scala.yml
@@ -0,0 +1,6 @@
+linux-x86-64: curl -fL https://github.com/coursier/coursier/releases/latest/download/cs-x86_64-pc-linux.gz | gzip -d > cs && chmod +x cs && ./cs setup
+linux-arm64: curl -fL https://github.com/VirtusLab/coursier-m1/releases/latest/download/cs-aarch64-pc-linux.gz | gzip -d > cs && chmod +x cs && ./cs setup
+macOS-x86-64: curl -fL https://github.com/coursier/coursier/releases/latest/download/cs-x86_64-apple-darwin.gz | gzip -d > cs && chmod +x cs && (xattr -d com.apple.quarantine cs || true) && ./cs setup
+macOS-arm64: curl -fL https://github.com/VirtusLab/coursier-m1/releases/latest/download/cs-aarch64-apple-darwin.gz | gzip -d > cs && chmod +x cs && (xattr -d com.apple.quarantine cs || true) && ./cs setup
+macOS-brew: brew install coursier && coursier setup
+windows-link: https://github.com/coursier/coursier/releases/latest/download/cs-x86_64-pc-win32.zip
diff --git a/_data/sip-data.yml b/_data/sip-data.yml
index 6a6b19fe68..0a351b24da 100644
--- a/_data/sip-data.yml
+++ b/_data/sip-data.yml
@@ -1,27 +1,47 @@
+design:
+ color: "#839496"
+ text: "Design"
+
+implementation:
+ color: "#839496"
+ text: "Implementation"
+
+submitted:
+ color: "#2aa198"
+ text: "Submitted"
+
under-review:
color: "#b58900"
text: "Under Review"
-pending:
+vote-requested:
color: "#b58900"
- text: "Pending"
-
-dormant:
- color: "#839496"
- text: "Dormant"
+ text: "Vote Requested"
-under-revision:
- color: "#2aa198"
- text: "Under Revision"
+waiting-for-implementation:
+ color: "#b58900"
+ text: "Waiting for Implementation"
accepted:
color: "#859900"
text: "Accepted"
-complete:
+shipped:
color: "#859900"
- text: "Complete"
+ text: "Shipped"
rejected:
color: "#dc322f"
text: "Rejected"
+
+withdrawn:
+ color: "#839496"
+ text: "Withdrawn"
+
+accept:
+ color: "#859900"
+ text: "Accept"
+
+reject:
+ color: "#dc322f"
+ text: "Reject"
diff --git a/_de/tutorials/scala-for-java-programmers.md b/_de/tutorials/scala-for-java-programmers.md
index e4d64108b7..9055d7caea 100644
--- a/_de/tutorials/scala-for-java-programmers.md
+++ b/_de/tutorials/scala-for-java-programmers.md
@@ -23,7 +23,7 @@ einfach ist, eignet es sich sehr gut, Scalas Funktionsweise zu demonstrieren, oh
über die Sprache wissen muss.
object HalloWelt {
- def main(args: Array[String]) {
+ def main(args: Array[String]): Unit = {
println("Hallo, Welt!")
}
}
@@ -93,7 +93,7 @@ Klassen der Java-Pakete importieren:
import java.text.DateFormat._
object FrenchDate {
- def main(args: Array[String]) {
+ def main(args: Array[String]): Unit = {
val now = new Date
val df = getDateInstance(LONG, Locale.FRANCE)
println(df format now)
@@ -183,7 +183,7 @@ einmal pro Sekunde aus.
println("Die Zeit vergeht wie im Flug.")
}
- def main(args: Array[String]) {
+ def main(args: Array[String]): Unit = {
oncePerSecond(timeFlies)
}
}
@@ -209,7 +209,7 @@ Variante des obigen Timer-Programmes verwendet eine anonyme Funktion anstatt der
}
}
- def main(args: Array[String]) {
+ def main(args: Array[String]): Unit = {
oncePerSecond(() => println("Die Zeit vergeht wie im Flug."))
}
}
@@ -256,7 +256,7 @@ Ein Problem der obigen Methoden `re` und `im` ist, dass man, um sie zu verwenden
Klammerpaar hinter ihren Namen anhängen muss:
object ComplexNumbers {
- def main(args: Array[String]) {
+ def main(args: Array[String]): Unit = {
val c = new Complex(1.2, 3.4)
println("imaginary part: " + c.im())
}
@@ -433,7 +433,7 @@ noch aus. Zu diesem Zweck soll eine `main`-Methode dienen, die den Ausdruck `(x+
Beispiel verwendet: zuerst wird der Wert in der Umgebung `{ x -> 5, y -> 7 }` berechnet und darauf
die beiden partiellen Ableitungen gebildet:
- def main(args: Array[String]) {
+ def main(args: Array[String]): Unit = {
val exp: Tree = Sum(Sum(Var("x"),Var("x")),Sum(Const(7),Var("y")))
val env: Environment = {
case "x" => 5
@@ -597,7 +597,7 @@ Um diese Referenz-Klasse zu verwenden, muss der generische Typ bei der Erzeugung
angegeben werden. Für einen Ganzzahl-Container soll folgendes Beispiel dienen:
object IntegerReference {
- def main(args: Array[String]) {
+ def main(args: Array[String]): Unit = {
val cell = new Reference[Int]
cell.set(13)
println("Reference contains the half of " + (cell.get * 2))
diff --git a/_es/overviews/core/actors.md b/_es/overviews/core/actors.md
deleted file mode 100644
index 19851b6c26..0000000000
--- a/_es/overviews/core/actors.md
+++ /dev/null
@@ -1,494 +0,0 @@
----
-layout: singlepage-overview
-title: API de actores en Scala
-
-partof: actors
-
-language: es
----
-
-**Philipp Haller and Stephen Tu**
-
-**Traducción e interpretación: Miguel Ángel Pastor Olivar**
-
-## Introducción
-
-La presente guía describe el API del paquete `scala.actors` de Scala 2.8/2.9. El documento se estructura en diferentes grupos lógicos. La jerarquía de "traits" es tenida en cuenta para llevar a cabo la estructuración de las secciones individuales. La atención se centra en el comportamiento exhibido en tiempo de ejecución por varios de los métodos presentes en los traits anteriores, complementando la documentación existente en el Scaladoc API.
-
-## Traits de actores: Reactor, ReplyReactor, y Actor
-
-### The Reactor trait
-
-`Reactor` es el padre de todos los traits relacionados con los actores. Heredando de este trait podremos definir actores con una funcionalidad básica de envío y recepción de mensajes.
-
-El comportamiento de un `Reactor` se define mediante la implementación de su método `act`. Este método es ejecutado una vez el `Reactor` haya sido iniciado mediante la invocación del método `start`, retornando el `Reactor`. El método `start`es *idempotente*, lo cual significa que la invocación del mismo sobre un actor que ya ha sido iniciado no surte ningún efecto.
-
-El trait `Reactor` tiene un parámetro de tipo `Msg` el cual determina el tipo de mensajes que un actor es capaz de recibir.
-
-La invocación del método `!` de un `Reactor` envía un mensaje al receptor. La operación de envío de un mensaje mediante el operador `!` es asíncrona por lo que el actor que envía el mensaje no se bloquea esperando a que el mensaje sea recibido sino que su ejecución continua de manera inmediata. Por ejemplo, `a ! msg` envia `msg` a `a`. Todos los actores disponen de un *buzón* encargado de regular los mensajes entrantes hasta que son procesados.
-
-El trait `Reactor` trait también define el método `forward`. Este método es heredado de `OutputChannel` y tiene el mismo efecto que el método `!`. Aquellos traits que hereden de `Reactor`, en particular el trait `ReplyActor`, sobreescriben este método para habilitar lo que comunmente se conocen como *"implicit reply destinations"* (ver a continuación)
-
-Un `Reactor` recibe mensajes utilizando el método `react`. Este método espera un argumento de tipo `PartialFunction[Msg, Unit]` el cual define cómo los mensajes de tipo `Msg` son tratados una vez llegan al buzón de un actor. En el siguiente ejemplo, el actor espera recibir la cadena "Hello", para posteriomente imprimir un saludo:
-
- react {
- case "Hello" => println("Hi there")
- }
-
-La invocación del método `react` nunca retorna. Por tanto, cualquier código que deba ejecutarse tras la recepción de un mensaje deberá ser incluido dentro de la función parcial pasada al método `react`. Por ejemplo, dos mensajes pueden ser recibidos secuencialmente mediante la anidación de dos llamadas a `react`:
-
- react {
- case Get(from) =>
- react {
- case Put(x) => from ! x
- }
- }
-
-El trait `Reactor` también ofrece una serie de estructuras de control que facilitan la programación utilizando el mecanismo de `react`.
-
-#### Terminación y estados de ejecución
-
-La ejecución de un `Reactor` finaliza cuando el cuerpo del método `act` ha sido completado. Un `Reactor` también pueden terminarse a si mismo de manera explícita mediante el uso del método `exit`. El tipo de retorno de `exit` es `Nothing`, dado que `exit` siempre dispara una excepción. Esta excepción únicamente se utiliza de manera interna y nunca debería ser capturada.
-
-Un `Reactor` finalizado pueden ser reiniciado mediante la invocación de su método `restart`. La invocación del método anterior sobre un `Reactor` que no ha terminado su ejecución lanza una excepción de tipo `IllegalStateException`. El reinicio de un actor que ya ha terminado provoca que el método `act` se ejecute nuevamente.
-
-El tipo `Reactor` define el método `getState`, el cual retorna, como un miembro de la enumeración `Actor.State`, el estado actual de la ejecución del actor. Un actor que todavía no ha sido iniciado se encuentra en el estado `Actor.State.New`. Si el actor se está ejecutando pero no está esperando por ningún mensaje su estado será `Actor.State.Runnable`. En caso de que el actor haya sido suspendido mientras espera por un mensaje estará en el estado `Actor.State.Suspended`. Por último, un actor ya terminado se encontrará en el estado `Actor.State.Terminated`.
-
-#### Manejo de excepciones
-
-El miembro `exceptionHandler` permite llevar a cabo la definición de un manejador de excepciones que estará habilitado durante toda la vida del `Reactor`:
-
- def exceptionHandler: PartialFunction[Exception, Unit]
-
-Este manejador de excepciones (`exceptionHandler`) retorna una función parcial que se utiliza para gestionar excepciones que no hayan sido tratadas de ninguna otra manera. Siempre que una excepción se propague fuera del método `act` de un `Reactor` el manejador anterior será aplicado a dicha excepción, permitiendo al actor ejecutar código de limpieza antes de que se termine. Nótese que la visibilidad de `exceptionHandler` es `protected`.
-
-El manejo de excepciones mediante el uso de `exceptionHandler` encaja a la perfección con las estructuras de control utilizadas para programas con el método `react`. Siempre que una excepción es manejada por la función parcial retornada por `excepctionHandler`, la ejecución continua con la "closure" actual:
-
- loop {
- react {
- case Msg(data) =>
- if (cond) // process data
- else throw new Exception("cannot process data")
- }
- }
-
-Assumiendo que `Reactor` sobreescribe el atributo `exceptionHandler`, tras el lanzamiento de una excepción en el cuerpo del método `react`, y una vez ésta ha sido gestionada, la ejecución continua con la siguiente iteración del bucle.
-
-### The ReplyReactor trait
-
-El trait `ReplyReactor` extiende `Reactor[Any]` y sobrescribe y/o añade los siguientes métodos:
-
-- El método `!` es sobrescrito para obtener una referencia al actor
- actual (el emisor). Junto al mensaje actual, la referencia a dicho
- emisor es enviada al buzón del actor receptor. Este último dispone de
- acceso al emisor del mensaje mediante el uso del método `sender` (véase más abajo).
-
-- El método `forward` es sobrescrito para obtener una referencia al emisor
- del mensaje que actualmente está siendo procesado. Junto con el mensaje
- actual, esta referencia es enviada como el emisor del mensaje actual.
- Como consuencia de este hecho, `forward` nos permite reenviar mensajes
- en nombre de actores diferentes al actual.
-
-- El método (añadido) `sender` retorna el emisor del mensaje que está siendo
- actualmente procesado. Puesto que un mensaje puede haber sido reenviado,
- `sender` podría retornar un actor diferente al que realmente envió el mensaje.
-
-- El método (añadido) `reply` envía una respuesta al emisor del último mensaje.
- `reply` también es utilizado para responder a mensajes síncronos o a mensajes
- que han sido enviados mediante un "future" (ver más adelante).
-
-- El método (añadido) `!?` ofrece un *mecanismo síncrono de envío de mensajes*.
- La invocación de `!?` provoca que el actor emisor del mensaje se bloquee hasta
- que se recibe una respuesta, momento en el cual retorna dicha respuesta. Existen
- dos variantes sobrecargadas. La versión con dos parámetros recibe un argumento
- adicional que representa el tiempo de espera (medido en milisegundos) y su tipo
- de retorno es `Option[Any]` en lugar de `Any`. En caso de que el emisor no
- reciba una respuesta en el periodo de espera establecido, el método `!?` retornará
- `None`; en otro caso retornará la respuesta recibida recubierta con `Some`.
-
-- Los métodos (añadidos) `!!` son similares al envío síncrono de mensajes en el sentido de
- que el receptor puede enviar una respuesta al emisor del mensaje. Sin embargo, en lugar
- de bloquear el actor emisor hasta que una respuesta es recibida, retornan una instancia de
- `Future`. Esta última puede ser utilizada para recuperar la respuesta del receptor una
- vez se encuentre disponible; asimismo puede ser utilizada para comprobar si la respuesta
- está disponible sin la necesidad de bloquear el emisor. Existen dos versiones sobrecargadas.
- La versión que acepta dos parámetros recibe un argumento adicional de tipo
- `PartialFunction[Any, A]`. Esta función parcial es utilizada para realizar el post-procesado de
- la respuesta del receptor. Básicamente, `!!` retorna un "future" que aplicará la anterior
- función parcial a la repuesta (una vez recibida). El resultado del "future" es el resultado
- de este post-procesado.
-
-- El método (añadido) `reactWithin` permite llevar a cabo la recepción de mensajes en un periodo
- determinado de tiempo. En comparación con el método `react`, recibe un parámetro adicional,
- `msec`, el cual representa el periodo de tiempo, expresado en milisegundos, hasta que el patrón `TIMEOUT`
- es satisfecho (`TIMEOUT` es un "case object" presente en el paquete `scala.actors`). Ejemplo:
-
- reactWithin(2000) {
- case Answer(text) => // process text
- case TIMEOUT => println("no answer within 2 seconds")
- }
-
-- El método `reactWithin` también permite realizar accesos no bloqueantes al buzón. Si
- especificamos un tiempo de espera de 0 milisegundos, primeramente el buzón será escaneado
- en busca de un mensaje que concuerde. En caso de que no exista ningún mensaje concordante
- tras el primer escaneo, el patrón `TIMEOUT` será satisfecho. Por ejemplo, esto nos permite
- recibir determinado tipo de mensajes donde unos tienen una prioridad mayor que otros:
-
- reactWithin(0) {
- case HighPriorityMsg => // ...
- case TIMEOUT =>
- react {
- case LowPriorityMsg => // ...
- }
- }
-
- En el ejemplo anterior, el actor procesa en primer lugar los mensajes `HighPriorityMsg` aunque
- exista un mensaje `LowPriorityMsg` más antiguo en el buzón. El actor sólo procesará mensajes
- `LowPriorityMsg` en primer lugar en aquella situación donde no exista ningún `HighProrityMsg`
- en el buzón.
-
-Adicionalmente, el tipo `ReplyActor` añade el estado de ejecución `Actor.State.TimedSuspended`. Un actor suspendido, esperando la recepción de un mensaje mediante el uso de `reactWithin` se encuentra en dicho estado.
-
-### El trait Actor
-
-El trait `Actor` extiende de `ReplyReactor` añadiendo y/o sobrescribiendo los siguientes miembros:
-
-- El método (añadido) `receive` se comporta del mismo modo que `react`, con la excepción
- de que puede retornar un resultado. Este hecho se ve reflejado en la definición del tipo,
- que es polimórfico en el tipo del resultado: `def receive[R](f: PartialFunction[Any, R]): R`.
- Sin embargo, la utilización de `receive` hace que el uso del actor
- sea más pesado, puesto que el hilo subyacente es bloqueado mientras
- el actor está esperando por la respuesta. El hilo bloqueado no está
- disponible para ejecutar otros actores hasta que la invocación del
- método `receive` haya retornado.
-
-- El método (añadido) `link` permite a un actor enlazarse y desenlazarse de otro
- actor respectivamente. El proceso de enlazado puede utilizarse para monitorizar
- y responder a la terminación de un actor. En particular, el proceso de enlazado
- afecta al comportamiento mostrado en la ejecución del método `exit` tal y como
- se escribe en el la documentación del API del trait `Actor`.
-
-- El atributo `trapExit` permite responder a la terminación de un actor enlazado,
- independientemente de los motivos de su terminación (es decir, carece de importancia
- si la terminación del actor es normal o no). Si `trapExit` toma el valor cierto en
- un actor, este nunca terminará por culpa de los actores enlazados. En cambio, siempre
- y cuando uno de sus actores enlazados finalice, recibirá un mensaje de tipo `Exit`.
- `Exit` es una "case class" que presenta dos atributos: `from` referenciando al actor
- que termina y `reason` conteniendo los motivos de la terminación.
-
-#### Terminación y estados de ejecución
-
-Cuando la ejecución de un actor finaliza, el motivo de dicha terminación puede ser
-establecida de manera explícita mediante la invocación de la siguiente variante
-del método `exit`:
-
- def exit(reason: AnyRef): Nothing
-
-Un actor cuyo estado de terminación es diferente del símbolo `'normal` propaga
-los motivos de su terminación a todos aquellos actores que se encuentren enlazados
-a él. Si el motivo de la terminación es una excepción no controlada, el motivo de
-finalización será una instancia de la "case class" `UncaughtException`.
-
-El trait `Actor` incluye dos nuevos estados de ejecución. Un actor que se encuentra
-esperando la recepción de un mensaje mediante la utilización del método `receive` se
-encuentra en el método `Actor.State.Blocked`. Un actor esperado la recepción de un
-mensaje mediante la utilización del método `receiveWithin` se encuentra en el estado
-`Actor.State.TimeBlocked`.
-
-## Estructuras de control
-
-El trait `Reactor` define una serie de estructuras de control que simplifican el mecanismo
-de programación con la función sin retorno `react`. Normalmente, una invocación al método
-`react` no retorna nunca. Si el actor necesita ejecutar código a continuación de la invocación
-anterior, tendrá que pasar, de manera explícita, dicho código al método `react` o utilizar
-algunas de las estructuras que encapsulan este comportamiento.
-
-La estructura de control más basica es `andThen`. Permite registrar una `closure` que será
-ejecutada una vez el actor haya terminado la ejecución de todo lo demas.
-
- actor {
- {
- react {
- case "hello" => // processing "hello"
- }: Unit
- } andThen {
- println("hi there")
- }
- }
-
-Por ejemplo, el actor anterior imprime un saludo tras realizar el procesado
-del mensaje `hello`. Aunque la invocación del método `react` no retorna,
-podemos utilizar `andThen` para registrar el código encargado de imprimir
-el saludo a continuación de la ejecución del actor.
-
-Nótese que existe una *atribución de tipo* a continuación de la invocación
-de `react` (`:Unit`). Básicamente, nos permite tratar el resultado de
-`react` como si fuese de tipo `Unit`, lo cual es legal, puesto que el resultado
-de una expresión siempre se puede eliminar. Es necesario llevar a cabo esta operación
-dado que `andThen` no puede ser un miembro del tipo `Unit`, que es el tipo del resultado
-retornado por `react`. Tratando el tipo de resultado retornado por `react` como
-`Unit` permite llevar a cabo la aplicación de una conversión implícita la cual
-hace que el miembro `andThen` esté disponible.
-
-El API ofrece unas cuantas estructuras de control adicionales:
-
-- `loop { ... }`. Itera de manera indefinidia, ejecutando el código entre
-las llaves en cada una de las iteraciones. La invocación de `react` en el
-cuerpo del bucle provoca que el actor se comporte de manera habitual ante
-la llegada de un nuevo mensaje. Posteriormente a la recepción del mensaje,
-la ejecución continua con la siguiente iteración del bucle actual.
-
-- `loopWhile (c) { ... }`. Ejecuta el código entre las llaves mientras la
-condición `c` tome el valor `true`. La invocación de `react` en el cuerpo
-del bucle ocasiona el mismo efecto que en el caso de `loop`.
-
-- `continue`. Continua con la ejecución de la closure actual. La invocación
-de `continue` en el cuerpo de un `loop`o `loopWhile` ocasionará que el actor
-termine la iteración en curso y continue con la siguiente. Si la iteración en
-curso ha sido registrada utilizando `andThen`, la ejecución continua con la
-segunda "closure" pasada como segundo argumento a `andThen`.
-
-Las estructuras de control pueden ser utilizadas en cualquier parte del cuerpo
-del método `act` y en los cuerpos de los métodos que, transitivamente, son
-llamados por `act`. Aquellos actores creados utilizando la sintáxis `actor { ... }`
-pueden importar las estructuras de control desde el objeto `Actor`.
-
-#### Futures
-
-Los traits `RepyActor` y `Actor` soportan operaciones de envío de mensajes
-(métodos `!!`) que, de manera inmediata, retornan un *future*. Un *future*,
-es una instancia del trait `Future` y actúa como un manejador que puede
-ser utilizado para recuperar la respuesta a un mensaje "send-with-future".
-
-El emisor de un mensaje "send-with-future" puede esperar por la respuesta del
-future *aplicando* dicha future. Por ejemplo, el envío de un mensaje mediante
-`val fut = a !! msg` permite al emisor esperar por el resultado del future
-del siguiente modo: `val res = fut()`.
-
-Adicionalmente, utilizando el método `isSet`, un `Future` puede ser consultado
-de manera no bloqueante para comprobar si el resultado está disponible.
-
-Un mensaje "send-with-future" no es el único modo de obtener una referencia a
-un future. Estos pueden ser creados utilizando el método `future`. En el siguiente
-ejemplo, `body` se ejecuta de manera concurrente, retornando un future como
-resultado.
-
- val fut = Future { body }
- // ...
- fut() // wait for future
-
-Lo que hace especial a los futures en el contexto de los actores es la posibilidad
-de recuperar su resultado utilizando las operaciones estándar de actores de
-recepción de mensajes como `receive`, etc. Además, es posible utilizar las operaciones
-basadas en eventos `react`y `reactWithin`. Esto permite a un actor esperar por el
-resultado de un future sin la necesidad de bloquear el hilo subyacente.
-
-Las operaciones de recepción basadas en actores están disponibles a través del
-atributo `inputChannel` del future. Dado un future de tipo `Future[T]`, el tipo
-de `inputChannel` es `InputChannel[T]`. Por ejemplo:
-
- val fut = a !! msg
- // ...
- fut.inputChannel.react {
- case Response => // ...
- }
-
-## Canales
-
-Los canales pueden ser utilizados para simplificar el manejo de mensajes
-que presentan tipos diferentes pero que son enviados al mismo actor. La
-jerarquía de canales se divide en `OutputChannel` e `InputChannel`.
-
-Los `OutputChannel` pueden ser utilizados para enviar mensajes. Un
-`OutputChannel` `out` soporta las siguientes operaciones:
-
-- `out ! msg`. Envía el mensaje `msg` a `out` de manera asíncrona. Cuando `msg`
- es enviado directamente a un actor se incluye un referencia al actor emisor
- del mensaje.
-
-- `out forward msg`. Reenvía el mensaje `msg` a `out` de manera asíncrona.
- El actor emisor se determina en el caso en el que `msg` es reenviado a
- un actor.
-
-- `out.receiver`. Retorna el único actor que está recibiendo mensajes que están
- siendo enviados al canal `out`.
-
-- `out.send(msg, from)`. Envía el mensaje `msg` a `out` de manera asíncrona,
- proporcionando a `from` como el emisor del mensaje.
-
-Nótese que el trait `OutputChannel` tiene un parámetro de tipo que especifica el
-tipo de los mensajes que pueden ser enviados al canal (utilizando `!`, `forward`,
-y `send`). Este parámetro de tipo es contra-variante:
-
- trait OutputChannel[-Msg]
-
-Los actores pueden recibir mensajes de un `InputChannel`. Del mismo modo que
-`OutputChannel`, el trait `InputChannel` presenta un parámetro de tipo que
-especifica el tipo de mensajes que pueden ser recibidos por el canal. En este caso,
-el parámetro de tipo es covariante:
-
- trait InputChannel[+Msg]
-
-Un `InputChannel[Msg]` `in` soportal las siguientes operaciones.
-
-- `in.receive { case Pat1 => ... ; case Patn => ... }` (y de manera similar,
- `in.receiveWithin`) recibe un mensaje proveniente de `in`. La invocación
- del método `receive` en un canal de entrada presenta la misma semántica
- que la operación estándar de actores `receive`. La única diferencia es que
- la función parcial pasada como argumento tiene tipo `PartialFunction[Msg, R]`
- donde `R` es el tipo de retorno de `receive`.
-
-- `in.react { case Pat1 => ... ; case Patn => ... }` (y de manera similar,
- `in.reactWithin`). Recibe un mensaje de `in` utilizando la operación basada en
- eventos `react`. Del mismo modo que la operación `react` en actores, el tipo
- de retorno es `Nothing`, indicando que las invocaciones de este método nunca
- retornan. Al igual que la operación `receive` anterior, la función parcial
- que se pasa como argumento presenta un tipo más específico:
-
- PartialFunction[Msg, Unit]
-
-### Creando y compartiendo canales
-
-Los canales son creados utilizando la clase concreta `Channel`. Esta clase extiende
-de `InputChannel` y `OutputChannel`. Un canal pueden ser compartido haciendo dicho
-canal visible en el ámbito de múltiples actores o enviándolo como mensaje.
-
-El siguiente ejemplo muestra la compartición mediante publicación en ámbitos:
-
- actor {
- var out: OutputChannel[String] = null
- val child = actor {
- react {
- case "go" => out ! "hello"
- }
- }
- val channel = new Channel[String]
- out = channel
- child ! "go"
- channel.receive {
- case msg => println(msg.length)
- }
- }
-
-La ejecución de este ejemplo imprime la cadena "5" en la consola. Nótese que el
-actor `child` únicamente tiene acceso a `out`, que es un `OutputChannel[String]`.
-La referencia al canal, la cual puede ser utilizada para llevar a cabo la recepción
-de mensajes, se encuentra oculta. Sin embargo, se deben tomar precauciones y
-asegurarse que el canal de salida es inicializado con un canal concreto antes de que
-`child` le envíe ningún mensaje. En el ejemplo que nos ocupa, esto es llevado a cabo
-mediante el mensaje "go". Cuando se está recibiendo de `channel` utilizando el método
-`channel.receive` podemos hacer uso del hecho que `msg` es de tipo `String`, y por
-lo tanto tiene un miembro `length`.
-
-Una alternativa a la compartición de canales es enviarlos a través de mensajes.
-El siguiente fragmento de código muestra un sencillo ejemplo de aplicación:
-
- case class ReplyTo(out: OutputChannel[String])
-
- val child = actor {
- react {
- case ReplyTo(out) => out ! "hello"
- }
- }
-
- actor {
- val channel = new Channel[String]
- child ! ReplyTo(channel)
- channel.receive {
- case msg => println(msg.length)
- }
- }
-
-La "case class" `ReplyTo` es un tipo de mensajes que utilizamos para distribuir
-una referencia a un `OutputChannel[String]`. Cuando el actor `child` recibe un
-mensaje de tipo `ReplyTo` éste envía una cadena a su canal de salida. El segundo
-actor recibe en el canal del mismo modo que anteriormente.
-
-## Planificadores
-
-Un `Reactor`(o una instancia de uno de sus subtipos) es ejecutado utilizando un
-*planificador*. El trait `Reactor` incluye el miembro `scheduler` el cual retorna el
-planificador utilizado para ejecutar sus instancias:
-
- def scheduler: IScheduler
-
-La plataforma de ejecución ejecuta los actores enviando tareas al planificador mediante
-el uso de los métodos `execute` definidos en el trait `IScheduler`. La mayor parte
-del resto de métodos definidos en este trait únicamente adquieren cierto protagonismo
-cuando se necesita implementar un nuevo planificador desde cero; algo que no es necesario
-en muchas ocasiones.
-
-Los planificadores por defecto utilizados para ejecutar instancias de `Reactor` y
-`Actor` detectan cuando los actores han finalizado su ejecución. En el momento que esto
-ocurre, el planificador se termina a si mismo (terminando con cualquier hilo que estuviera
-en uso por parte del planificador). Sin embargo, algunos planificadores como el
-`SingleThreadedScheduler` (definido en el paquete `scheduler`) necesita ser terminado de
-manera explícita mediante la invocación de su método `shutdown`).
-
-La manera más sencilla de crear un planificador personalizado consisten en extender la clase
-`SchedulerAdapter`, implementando el siguiente método abstracto:
-
- def execute(fun: => Unit): Unit
-
-Por norma general, una implementación concreata utilizaría un pool de hilos para llevar a cabo
-la ejecución del argumento por nombre `fun`.
-
-## Actores remotos
-
-Esta sección describe el API de los actores remotos. Su principal interfaz es el objecto
-`RemoteActor` definido en el paquete `scala.actors.remote`. Este objeto facilita el conjunto
-de métodos necesarios para crear y establecer conexiones a instancias de actores remotos. En los
-fragmentos de código que se muestran a continuación se asume que todos los miembros de
-`RemoteActor` han sido importados; la lista completa de importaciones utilizadas es la siguiente:
-
- import scala.actors._
- import scala.actors.Actor._
- import scala.actors.remote._
- import scala.actors.remote.RemoteActor._
-
-### Iniciando actores remotos
-
-Un actore remot es identificado de manera unívoca por un `Symbol`. Este símbolo
-es único para la instancia de la máquina virual en la que se está ejecutando un
-actor. Un actor remoto identificado con el nombre `myActor` puede ser creado del
-siguiente modo.
-
- class MyActor extends Actor {
- def act() {
- alive(9000)
- register('myActor, self)
- // ...
- }
- }
-
-Nótese que el nombre únicamente puede ser registrado con un único actor al mismo tiempo.
-Por ejemplo, para registrar el actor *A* como `'myActor` y posteriormente registrar otro
-actor *B* como `'myActor`, debería esperar hasta que *A* haya finalizado. Este requisito
-aplica a lo largo de todos los puertos, por lo que registrando a *B* en un puerto diferente
-no sería suficiente.
-
-### Connecting to remote actors
-
-Establecer la conexión con un actor remoto es un proceso simple. Para obtener una referencia remota
-a un actor remoto que está ejecutándose en la máquina `myMachine` en el puerto 8000 con el nombre
-`'anActor`, tendremos que utilizar `select`del siguiente modo:
-
- val myRemoteActor = select(Node("myMachine", 8000), 'anActor)
-
-El actor retornado por `select` es de tipo `AbstractActor`, que proporciona esencialmente el mismo
-interfaz que un actor normal, y por lo tanto es compatible con las habituales operaciones de envío
-de mensajes:
-
- myRemoteActor ! "Hello!"
- receive {
- case response => println("Response: " + response)
- }
- myRemoteActor !? "What is the meaning of life?" match {
- case 42 => println("Success")
- case oops => println("Failed: " + oops)
- }
- val future = myRemoteActor !! "What is the last digit of PI?"
-
-Nótese que la operación `select` es perezosa; no inicializa ninguna conexión de red. Simplemente crea
-una nueva instancia de `AbstractActor` que está preparada para iniciar una nueva conexión de red en el
-momento en que sea necesario (por ejemplo cuando el método '!' es invocado).
diff --git a/_es/overviews/parallel-collections/architecture.md b/_es/overviews/parallel-collections/architecture.md
index 8e60e87a59..138a5dee08 100644
--- a/_es/overviews/parallel-collections/architecture.md
+++ b/_es/overviews/parallel-collections/architecture.md
@@ -87,7 +87,7 @@ de la librería de colecciones secuenciales -- de hecho, "replican" los correspo
traits presentes en el framework de colecciones secuenciales, tal y como se muestra
a continuación.
-[]({{ site.baseurl }}/resources/images/parallel-collections-hierarchy.png)
+[]({{ site.baseurl }}/resources/images/parallel-collections-hierarchy.png)
Jerarquía de clases de las librerías de colecciones secuenciales y paralelas de Scala
diff --git a/_es/tour/abstract-type-members.md b/_es/tour/abstract-type-members.md
index 841fa8778e..1e9afc50d7 100644
--- a/_es/tour/abstract-type-members.md
+++ b/_es/tour/abstract-type-members.md
@@ -40,16 +40,14 @@ abstract class IntSeqBuffer extends SeqBuffer {
type U = Int
}
-object AbstractTypeTest1 extends App {
- def newIntSeqBuf(elem1: Int, elem2: Int): IntSeqBuffer =
- new IntSeqBuffer {
- type T = List[U]
- val element = List(elem1, elem2)
- }
- val buf = newIntSeqBuf(7, 8)
- println("length = " + buf.length)
- println("content = " + buf.element)
-}
+def newIntSeqBuf(elem1: Int, elem2: Int): IntSeqBuffer =
+ new IntSeqBuffer {
+ type T = List[U]
+ val element = List(elem1, elem2)
+ }
+val buf = newIntSeqBuf(7, 8)
+println("length = " + buf.length)
+println("content = " + buf.element)
```
El tipo retornado por el método `newIntSeqBuf` está ligado a la especialización del trait `Buffer` en el cual el tipo `U` es ahora equivalente a `Int`. Existe un tipo alias similar en la instancia de la clase anónima dentro del cuerpo del método `newIntSeqBuf`. En ese lugar se crea una nueva instancia de `IntSeqBuffer` en la cual el tipo `T` está ligado a `List[Int]`.
diff --git a/_es/tour/automatic-closures.md b/_es/tour/automatic-closures.md
deleted file mode 100644
index bb26c5a665..0000000000
--- a/_es/tour/automatic-closures.md
+++ /dev/null
@@ -1,65 +0,0 @@
----
-layout: tour
-title: Construcción de closures automáticas
-partof: scala-tour
-
-num: 16
-language: es
-
-next-page: operators
-previous-page: multiple-parameter-lists
----
-
-Scala permite pasar funciones sin parámetros como parámetros de un método. Cuando un método así es invocado, los parámetros reales de la función enviada sin parámetros no son evaluados y una función "nularia" (de aridad cero, 0-aria, o sin parámetros) es pasada en su lugar. Esta función encapsula el comportamiento del parámetro correspondiente (comunmente conocido como "llamada por nombre").
-
-Para aclarar un poco esto aquí se muestra un ejemplo:
-
- object TargetTest1 extends App {
- def whileLoop(cond: => Boolean)(body: => Unit): Unit =
- if (cond) {
- body
- whileLoop(cond)(body)
- }
- var i = 10
- whileLoop (i > 0) {
- println(i)
- i -= 1
- }
- }
-
-La función `whileLoop` recibe dos parámetros `cond` y `body`. Cuando la función es llamada, los parámetros reales no son evaluados en ese momento. Pero cuando los parámetros son utilizados en el cuerpo de la función `whileLoop`, las funciones nularias creadas implícitamente serán evaluadas en su lugar. Así, nuestro método `whileLoop` implementa un bucle tipo Java mediante una implementación recursiva.
-
-Es posible combinar el uso de [operadores de infijo y postfijo (infix/postfix)](operators.html) con este mecanismo para crear declaraciones más complejas (con una sintaxis agradadable).
-
-Aquí mostramos la implementación de una declaración tipo repetir-a-menos-que (repetir el bucle a no ser que se cumpla X condición):
-
- object TargetTest2 extends App {
- def loop(body: => Unit): LoopUnlessCond =
- new LoopUnlessCond(body)
- protected class LoopUnlessCond(body: => Unit) {
- def unless(cond: => Boolean) {
- body
- if (!cond) unless(cond)
- }
- }
- var i = 10
- loop {
- println("i = " + i)
- i -= 1
- } unless (i == 0)
- }
-
-La función `loop` solo acepta el cuerpo de un bucle y retorna una instancia de la clase `LoopUnlessCond` (la cual encapsula el cuerpo del objeto). Es importante notar que en este punto el cuerpo del bucle no ha sido evaluado aún. La clase `LoopUnlessCond` tiene un método `unless` el cual puede ser usado como un *operador de infijo (infix)*. De esta manera podemos lograr una sintaxis muy natural para nuestro nuevo bucle `repetir { a_menos_que ( )`.
-
-A continuación se expone el resultado de la ejecución de `TargetTest2`:
-
- i = 10
- i = 9
- i = 8
- i = 7
- i = 6
- i = 5
- i = 4
- i = 3
- i = 2
- i = 1
diff --git a/_es/tour/basics.md b/_es/tour/basics.md
index ba3519ef02..484470a508 100644
--- a/_es/tour/basics.md
+++ b/_es/tour/basics.md
@@ -13,16 +13,14 @@ En esta página, practicaremos conceptos básicos de Scala.
## Probando Scala en el navegador
-Puedes ejecutar Scala en tu navegador con ScalaFiddle.
+Puedes ejecutar Scala en tu navegador con Scastie.
-1. Ve a [https://scalafiddle.io](https://scalafiddle.io).
+1. Ve a [Scastie](https://scastie.scala-lang.org/).
2. Escribe `println("Hello, world!")` en el panel a la izquierda.
3. Presiona el botón "Run". En el panel de la derecha aparecerá el resultado.
Así, de manera fácil y sin preparación, puedes probar fragmentos de código Scala.
-Muchos ejemplos de código en esta documentación están integrados con ScalaFiddle, y así puedes probarlos directamente solo con pulsar el botón "Run".
-
## Expresiones
Las expresiones son sentencias computables.
@@ -33,14 +31,12 @@ Las expresiones son sentencias computables.
Se puede ver el resultado de evaluar expresiones usando `println`.
-{% scalafiddle %}
```scala mdoc
println(1) // 1
println(1 + 1) // 2
println("Hello!") // Hello!
println("Hello," + " world!") // Hello, world!
```
-{% endscalafiddle %}
## Valores
@@ -110,21 +106,17 @@ La lista de parámetros de la función está a la izquierda de la flecha `=>`, y
También podemos asignarle un nombre a la función.
-{% scalafiddle %}
```scala mdoc
val addOne = (x: Int) => x + 1
println(addOne(1)) // 2
```
-{% endscalafiddle %}
Las funciones pueden tomar varios parámetros.
-{% scalafiddle %}
```scala mdoc
val add = (x: Int, y: Int) => x + y
println(add(1, 2)) // 3
```
-{% endscalafiddle %}
O ninguno.
@@ -135,27 +127,23 @@ println(getTheAnswer()) // 42
## Métodos
-Los métodos se parecen y comportan casi como a las funciones, pero se diferencian en dos aspectos clave:
+Los métodos se parecen y comportan casi como a las funciones, pero se diferencian en dos aspectos clave:
Un método se define con la palabra reservada `def`, seguida por el nombre del método, la lista de parámetros, el tipo de valores que el método devuelve, y el cuerpo del método.
-{% scalafiddle %}
```scala mdoc:nest
def add(x: Int, y: Int): Int = x + y
println(add(1, 2)) // 3
```
-{% endscalafiddle %}
Observe que el tipo de retorno se declara _después_ de la lista de parámetros, y separado con dos puntos, p.ej. `: Int`.
Un método puede tener varias listas de parámetros.
-{% scalafiddle %}
```scala mdoc
def addThenMultiply(x: Int, y: Int)(multiplier: Int): Int = (x + y) * multiplier
println(addThenMultiply(1, 2)(3)) // 9
```
-{% endscalafiddle %}
O ninguna lista de parámetros.
@@ -168,7 +156,6 @@ Hay otras diferencias, pero para simplificar, podemos pensar que son similares a
Los métodos también pueden tener expresiones de varias lineas.
-{% scalafiddle %}
```scala mdoc
def getSquareString(input: Double): String = {
val square = input * input
@@ -176,7 +163,6 @@ def getSquareString(input: Double): String = {
}
println(getSquareString(2.5)) // 6.25
```
-{% endscalafiddle %}
La ultima expresión en el cuerpo del método es el valor de retorno del mismo.
(Scala tiene una palabra reservada `return`, pero se usa raramente y no se aconseja usarla)
@@ -212,7 +198,7 @@ Una case class se define con las palabras reservadas `case class`:
case class Point(x: Int, y: Int)
```
-Se puede crear una instancia de una `case class`, sin usar la palabra reservada `new`.
+Se puede crear una instancia de una `case class`, sin usar la palabra reservada `new`.
```scala mdoc
val point = Point(1, 2)
@@ -224,15 +210,15 @@ Y son comparadas por valor.
```scala mdoc
if (point == anotherPoint) {
- println(point + " and " + anotherPoint + " are the same.")
+ println(s"$point and $anotherPoint are the same.")
} else {
- println(point + " and " + anotherPoint + " are different.")
+ println(s"$point and $anotherPoint are different.")
} // Point(1,2) and Point(1,2) are the same.
if (point == yetAnotherPoint) {
- println(point + " and " + yetAnotherPoint + " are the same.")
+ println(s"$point and $yetAnotherPoint are the same.")
} else {
- println(point + " and " + yetAnotherPoint + " are different.")
+ println(s"$point and $yetAnotherPoint are different.")
} // Point(1,2) and Point(2,2) are different.
```
@@ -279,7 +265,6 @@ trait Greeter {
Un `trait` también puede definir un método, o un valor, con una implementación por defecto.
-{% scalafiddle %}
```scala mdoc:reset
trait Greeter {
def greet(name: String): Unit =
@@ -304,7 +289,6 @@ greeter.greet("Scala developer") // Hello, Scala developer!
val customGreeter = new CustomizableGreeter("How are you, ", "?")
customGreeter.greet("Scala developer") // How are you, Scala developer?
```
-{% endscalafiddle %}
Aquí, `DefaultGreeter` extiende un solo trait, pero puede extender múltiples traits.
diff --git a/_es/tour/case-classes.md b/_es/tour/case-classes.md
index c47a3b9428..7a4989bde5 100644
--- a/_es/tour/case-classes.md
+++ b/_es/tour/case-classes.md
@@ -19,7 +19,7 @@ A continuación se muestra un ejemplo para una jerarquía de clases la cual cons
case class Fun(arg: String, body: Term) extends Term
case class App(f: Term, v: Term) extends Term
-Esta jerarquía de clases puede ser usada para representar términos de [cálculo lambda no tipado](https://www.ezresult.com/article/Lambda_calculus). Para facilitar la construcción de instancias de clases Case, Scala no requiere que se utilice la primitiva `new`. Simplemente es posible utilizar el nombre de la clase como una llamada a una función.
+Esta jerarquía de clases puede ser usada para representar términos de [cálculo lambda no tipado](https://es.wikipedia.org/wiki/C%C3%A1lculo_lambda). Para facilitar la construcción de instancias de clases Case, Scala no requiere que se utilice la primitiva `new`. Simplemente es posible utilizar el nombre de la clase como una llamada a una función.
Aquí un ejemplo:
diff --git a/_es/tour/classes.md b/_es/tour/classes.md
index 90bd399be0..3f3939b3bc 100644
--- a/_es/tour/classes.md
+++ b/_es/tour/classes.md
@@ -29,7 +29,7 @@ Las clases en Scala son parametrizadas con argumentos constructores (inicializad
Para instanciar una clase es necesario usar la primitiva `new`, como se muestra en el siguiente ejemplo:
object Classes {
- def main(args: Array[String]) {
+ def main(args: Array[String]): Unit = {
val pt = new Point(1, 2)
println(pt)
pt.move(10, 10)
diff --git a/_es/tour/generic-classes.md b/_es/tour/generic-classes.md
index 2a1ed5a2ba..b89b603ae3 100644
--- a/_es/tour/generic-classes.md
+++ b/_es/tour/generic-classes.md
@@ -14,13 +14,15 @@ Tal como en Java 5, Scala provee soporte nativo para clases parametrizados con t
A continuación se muestra un ejemplo:
- class Stack[T] {
- var elems: List[T] = Nil
- def push(x: T): Unit =
- elems = x :: elems
- def top: T = elems.head
- def pop() { elems = elems.tail }
- }
+```scala mdoc
+class Stack[T] {
+ var elems: List[T] = Nil
+ def push(x: T): Unit =
+ elems = x :: elems
+ def top: T = elems.head
+ def pop(): Unit = { elems = elems.tail }
+}
+```
La clase `Stack` modela una pila mutable que contiene elementos de un tipo arbitrario `T` (se dice, "una pila de elementos `T`). Los parámetros de tipos nos aseguran que solo elementos legales (o sea, del tipo `T`) sean insertados en la pila (apilados). De forma similar, con los parámetros de tipo podemos expresar que el método `top` solo devolverá elementos de un tipo dado (en este caso `T`).
diff --git a/_es/tour/inner-classes.md b/_es/tour/inner-classes.md
index 461c72eeb1..9b04862d27 100644
--- a/_es/tour/inner-classes.md
+++ b/_es/tour/inner-classes.md
@@ -12,44 +12,50 @@ previous-page: implicit-parameters
En Scala es posible que las clases tengan como miembro otras clases. A diferencia de lenguajes similares a Java donde ese tipo de clases internas son miembros de las clases que las envuelven, en Scala esas clases internas están ligadas al objeto externo. Para ilustrar esta diferencia, vamos a mostrar rápidamente una implementación del tipo grafo:
- class Graph {
- class Node {
- var connectedNodes: List[Node] = Nil
- def connectTo(node: Node) {
- if (!connectedNodes.exists(node.equals)) {
- connectedNodes = node :: connectedNodes
- }
- }
- }
- var nodes: List[Node] = Nil
- def newNode: Node = {
- val res = new Node
- nodes = res :: nodes
- res
+```scala mdoc
+class Graph {
+ class Node {
+ var connectedNodes: List[Node] = Nil
+ def connectTo(node: Node): Unit = {
+ if (!connectedNodes.exists(node.equals)) {
+ connectedNodes = node :: connectedNodes
}
}
+ }
+ var nodes: List[Node] = Nil
+ def newNode: Node = {
+ val res = new Node
+ nodes = res :: nodes
+ res
+ }
+}
+```
En nuestro programa, los grafos son representados mediante una lista de nodos. Estos nodos son objetos de la clase interna `Node`. Cada nodo tiene una lista de vecinos que se almacena en la lista `connectedNodes`. Ahora podemos crear un grafo con algunos nodos y conectarlos incrementalmente:
- object GraphTest extends App {
- val g = new Graph
- val n1 = g.newNode
- val n2 = g.newNode
- val n3 = g.newNode
- n1.connectTo(n2)
- n3.connectTo(n1)
- }
+```scala mdoc:nest
+def graphTest: Unit = {
+ val g = new Graph
+ val n1 = g.newNode
+ val n2 = g.newNode
+ val n3 = g.newNode
+ n1.connectTo(n2)
+ n3.connectTo(n1)
+}
+```
Ahora vamos a completar el ejemplo con información relacionada al tipado para definir explicitamente de qué tipo son las entidades anteriormente definidas:
- object GraphTest extends App {
- val g: Graph = new Graph
- val n1: g.Node = g.newNode
- val n2: g.Node = g.newNode
- val n3: g.Node = g.newNode
- n1.connectTo(n2)
- n3.connectTo(n1)
- }
+```scala mdoc:nest
+def graphTest: Unit = {
+ val g: Graph = new Graph
+ val n1: g.Node = g.newNode
+ val n2: g.Node = g.newNode
+ val n3: g.Node = g.newNode
+ n1.connectTo(n2)
+ n3.connectTo(n1)
+}
+```
El código anterior muestra que al tipo del nodo le es prefijado con la instancia superior (que en nuestro ejemplo es `g`). Si ahora tenemos dos grafos, el sistema de tipado de Scala no nos permite mezclar nodos definidos en un grafo con nodos definidos en otro, ya que los nodos del otro grafo tienen un tipo diferente.
@@ -70,7 +76,7 @@ Por favor note que en Java la última linea del ejemplo anterior hubiese sido co
class Graph {
class Node {
var connectedNodes: List[Graph#Node] = Nil // Graph#Node en lugar de Node
- def connectTo(node: Graph#Node) {
+ def connectTo(node: Graph#Node): Unit = {
if (!connectedNodes.exists(node.equals)) {
connectedNodes = node :: connectedNodes
}
diff --git a/_es/tour/mixin-class-composition.md b/_es/tour/mixin-class-composition.md
index 9221859891..bd53274158 100644
--- a/_es/tour/mixin-class-composition.md
+++ b/_es/tour/mixin-class-composition.md
@@ -22,7 +22,7 @@ A diferencia de lenguajes que solo soportan _herencia simple_, Scala tiene una n
A continuación, considere una clase mezcla la cual extiende `AbsIterator` con un método `foreach` el cual aplica una función dada a cada elemento retornado por el iterador. Para definir una clase que puede usarse como una clase mezcla usamos la palabra clave `trait`.
trait RichIterator extends AbsIterator {
- def foreach(f: T => Unit) { while (hasNext) f(next()) }
+ def foreach(f: T => Unit): Unit = { while (hasNext) f(next()) }
}
Aquí se muestra una clase iterador concreta, la cual retorna caracteres sucesivos de una cadena de caracteres dada:
@@ -37,7 +37,7 @@ Aquí se muestra una clase iterador concreta, la cual retorna caracteres sucesiv
Nos gustaría combinar la funcionalidad de `StringIterator` y `RichIterator` en una sola clase. Solo con herencia simple e interfaces esto es imposible, ya que ambas clases contienen implementaciones para sus miembros. Scala nos ayuda con sus _compisiciones de clases mezcladas_. Permite a los programadores reutilizar el delta de la definición de una clase, esto es, todas las nuevas definiciones que no son heredadas. Este mecanismo hace posible combinar `StringIterator` con `RichIterator`, como es hecho en el siguiente programa, el cual imprime una columna de todos los caracteres de una cadena de caracteres dada.
object StringIteratorTest {
- def main(args: Array[String]) {
+ def main(args: Array[String]): Unit = {
class Iter extends StringIterator("Scala") with RichIterator
val iter = new Iter
iter foreach println
diff --git a/_es/tour/multiple-parameter-lists.md b/_es/tour/multiple-parameter-lists.md
index 9ed0531042..83b7218c0b 100644
--- a/_es/tour/multiple-parameter-lists.md
+++ b/_es/tour/multiple-parameter-lists.md
@@ -6,7 +6,7 @@ partof: scala-tour
num: 15
language: es
-next-page: automatic-closures
+next-page: operators
previous-page: nested-functions
---
@@ -26,18 +26,15 @@ def foldLeft[B](z: B)(op: (B, A) => B): B
Comenzando con un valor inicial 0, `foldLeft` aplica la función `(m, n) => m + n` a cada uno de los elementos de la lista y al valor acumulado previo.
-{% scalafiddle %}
```scala mdoc
val numbers = List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
val res = numbers.foldLeft(0)((m, n) => m + n)
println(res) // 55
```
-{% endscalafiddle %}
A continuación se muestra otro ejemplo:
-{% scalafiddle %}
```scala mdoc
object CurryTest extends App {
@@ -53,7 +50,6 @@ A continuación se muestra otro ejemplo:
println(filter(nums, modN(3)))
}
```
-{% endscalafiddle %}
_Nota: el método `modN` está parcialmente aplicado en las dos llamadas a `filter`; esto significa que solo su primer argumento es realmente aplicado. El término `modN(2)` devuelve una función de tipo `Int => Boolean` y es por eso un posible candidato para el segundo argumento de la función `filter`._
diff --git a/_es/tour/named-arguments.md b/_es/tour/named-arguments.md
index 38dd0574d4..fe38fe15d4 100644
--- a/_es/tour/named-arguments.md
+++ b/_es/tour/named-arguments.md
@@ -11,24 +11,24 @@ previous-page: default-parameter-values
En la invocación de métodos y funciones se puede usar el nombre de las variables explícitamente en la llamada, de la siguiente manera:
- def imprimirNombre(nombre:String, apellido:String) = {
+ def imprimirNombre(nombre: String, apellido: String) = {
println(nombre + " " + apellido)
}
imprimirNombre("John","Smith")
// Imprime "John Smith"
- imprimirNombre(first = "John",last = "Smith")
+ imprimirNombre(nombre = "John", apellido = "Smith")
// Imprime "John Smith"
- imprimirNombre(last = "Smith",first = "John")
+ imprimirNombre(apellido = "Smith", nombre = "John")
// Imprime "John Smith"
Note que una vez que se utilizan parámetros nombrados en la llamada, el orden no importa, mientras todos los parámetros sean nombrados. Esta característica funciona bien en conjunción con valores de parámetros por defecto:
- def imprimirNombre(nombre:String = "John", apellido:String = "Smith") = {
+ def imprimirNombre(nombre: String = "John", apellido: String = "Smith") = {
println(nombre + " " + apellido)
}
- printName(apellido = "Jones")
+ imprimirNombre(apellido = "Jones")
// Imprime "John Jones"
language: es
diff --git a/_es/tour/operators.md b/_es/tour/operators.md
index a2d3b5e4be..6aeb98e046 100644
--- a/_es/tour/operators.md
+++ b/_es/tour/operators.md
@@ -7,7 +7,7 @@ num: 17
language: es
next-page: higher-order-functions
-previous-page: automatic-closures
+previous-page: multiple-parameter-lists
---
En Scala, cualquier método el cual reciba un solo parámetro puede ser usado como un *operador de infijo (infix)*. Aquí se muestra la definición de la clase `MyBool`, la cual define tres métodos `and`, `or`, y `negate`.
diff --git a/_es/tour/self-types.md b/_es/tour/self-types.md
index 79714212a7..df02b7dc0a 100644
--- a/_es/tour/self-types.md
+++ b/_es/tour/self-types.md
@@ -91,7 +91,7 @@ Por favor nótese que en esta clase nos es posible instanciar `NodoImpl` porque
Aquí hay un ejemplo de uso de la clase `GrafoDirigidoConcreto`:
- object GraphTest extends App {
+ def graphTest: Unit = {
val g: Grafo = new GrafoDirigidoConcreto
val n1 = g.agregarNodo
val n2 = g.agregarNodo
diff --git a/_es/tour/singleton-objects.md b/_es/tour/singleton-objects.md
index 83aa22ef9b..dceed2d7ad 100644
--- a/_es/tour/singleton-objects.md
+++ b/_es/tour/singleton-objects.md
@@ -26,7 +26,7 @@ Un objeto singleton puede extender clases y _traits_. De hecho, una [clase Case]
## Acompañantes ##
-La mayoría de los objetos singleton no están solos, sino que en realidad están asociados con clases del mismo nombre. El "objeto singleton del mismo nombre" de una case Case, mencionada anteriormente es un ejemplo de esto. Cuando esto sucede, el objeto singleton es llamado el *objeto acompañante* de la clase, y la clase es a su vez llamada la *clase acompañante* del objeto.
+La mayoría de los objetos singleton no están solos, sino que en realidad están asociados con clases del mismo nombre. El "objeto singleton del mismo nombre" de una clase Case, mencionada anteriormente es un ejemplo de esto. Cuando esto sucede, el objeto singleton es llamado el *objeto acompañante* de la clase, y la clase es a su vez llamada la *clase acompañante* del objeto.
[Scaladoc](/style/scaladoc.html) proporciona un soporte especial para ir y venir entre una clase y su acompañante: Si el gran círculo conteniendo la “C” u la “O” tiene su borde inferior doblado hacia adentro, es posible hacer click en el círculo para ir a su acompañante.
diff --git a/_es/tour/tour-of-scala.md b/_es/tour/tour-of-scala.md
index 19b4f60af8..b742b271ab 100644
--- a/_es/tour/tour-of-scala.md
+++ b/_es/tour/tour-of-scala.md
@@ -37,7 +37,6 @@ El [mecanismo de inferencia de tipos locales](type-inference.html) se encarga de
En la práctica, el desarrollo de aplicaciones específicas para un dominio generalmente requiere de "Lenguajes de dominio específico" (DSL). Scala provee una única combinación de mecanismos del lenguaje que simplifican la creación de construcciones propias del lenguaje en forma de bibliotecas:
* cualquier método puede ser usado como un operador de [infijo o postfijo](operators.html)
-* [las closures son construidas automáticamente dependiendo del tipo esperado](automatic-closures.html) (tipos objetivo).
El uso conjunto de ambas características facilita la definición de nuevas sentencias sin tener que extender la sintaxis y sin usar facciones de meta-programación como tipo macros.
diff --git a/_es/tour/unified-types.md b/_es/tour/unified-types.md
index 5f37f7b47d..3a1db1e651 100644
--- a/_es/tour/unified-types.md
+++ b/_es/tour/unified-types.md
@@ -17,7 +17,7 @@ A diferencia de Java, todos los valores en Scala son objetos (incluyendo valores
## Jerarquía de clases en Scala ##
La superclase de todas las clases, `scala.Any`, tiene dos subclases directas, `scala.AnyVal` y `scala.AnyRef` que representan dos mundos de clases muy distintos: clases para valores y clases para referencias. Todas las clases para valores están predefinidas; se corresponden con los tipos primitivos de los lenguajes tipo Java. Todas las otras clases definen tipos referenciables. Las clases definidas por el usuario son definidas como tipos referenciables por defecto, es decir, siempre (indirectamente) extienden de `scala.AnyRef`. Toda clase definida por usuario en Scala extiende implicitamente el trait `scala.ScalaObject`. Clases pertenecientes a la infraestructura en la cual Scala esté corriendo (ejemplo, el ambiente de ejecución de Java) no extienden de `scala.ScalaObject`. Si Scala es usado en el contexto de un ambiente de ejecución de Java, entonces `scala.AnyRef` corresponde a `java.lang.Object`.
-Por favor note que el diagrama superior también muestra conversiones implícitas llamadas viestas entre las clases para valores.
+Por favor note que el diagrama superior también muestra conversiones implícitas llamadas vistas entre las clases para valores.
Aquí se muestra un ejemplo que demuestra que tanto valores numéricos, de caracteres, buleanos y funciones son objetos, tal como cualquier otro objeto:
diff --git a/_es/tutorials/scala-for-java-programmers.md b/_es/tutorials/scala-for-java-programmers.md
index f4cc568f84..120d93d316 100644
--- a/_es/tutorials/scala-for-java-programmers.md
+++ b/_es/tutorials/scala-for-java-programmers.md
@@ -18,7 +18,7 @@ Este documento provee una rápida introducción al lenguaje Scala como también
Como primer ejemplo, usaremos el programa *Hola mundo* estándar. No es muy fascinante, pero de esta manera resulta fácil demostrar el uso de herramientas de Scala sin saber demasiado acerca del lenguaje. Veamos como luce:
object HolaMundo {
- def main(args: Array[String]) {
+ def main(args: Array[String]): Unit = {
println("¡Hola, mundo!")
}
}
@@ -59,7 +59,7 @@ Las librerías de clases de Java definen clases de utilería poderosas, como `Da
import java.text.DateFormat._
object FrenchDate {
- def main(args: Array[String]) {
+ def main(args: Array[String]): Unit = {
val ahora = new Date
val df = getDateInstance(LONG, Locale.FRANCE)
println(df format ahora)
@@ -116,7 +116,7 @@ En el siguiente programa, la función del temporizador se llama `unaVezPorSegund
def tiempoVuela() {
println("El tiempo vuela como una flecha...")
}
- def main(args: Array[String]) {
+ def main(args: Array[String]): Unit = {
unaVezPorSegundo(tiempoVuela)
}
}
@@ -134,7 +134,7 @@ El programa anterior es fácil de entender, pero puede ser refinado aún más. P
Thread sleep 1000
}
}
- def main(args: Array[String]) {
+ def main(args: Array[String]): Unit = {
unaVezPorSegundo(
() => println("El tiempo vuela como una flecha...")
)
@@ -167,7 +167,7 @@ El compilador no es siempre capaz de inferir los tipos como lo hace aquí, y des
Un pequeño problema de los métodos `re` e `im` es que para poder llamarlos es necesario agregar un par de paréntesis vacíos después de sus nombres, como muestra el siguiente ejemplo:
object NumerosComplejos {
- def main(args: Array[String]) {
+ def main(args: Array[String]): Unit = {
val c = new Complejo(1.2, 3.4)
println("Parte imaginaria: " + c.im())
}
@@ -282,7 +282,7 @@ Esta función introduce dos nuevos conceptos relacionados al pattern matching. P
No hemos explorado el completo poder del pattern matching aún, pero nos detendremos aquí para mantener este documento corto. Todavía nos queda pendiente ver cómo funcionan las dos funciones de arriba en un ejemplo real. Para ese propósito, escribamos una función main simple que realice algunas operaciones sobre la expresión `(x+x)+(7+y)`: primero computa su valor en el entorno `{ x -> 5, y -> 7 }` y después computa su derivada con respecto a `x` y después a `y`.
- def main(args: Array[String]) {
+ def main(args: Array[String]): Unit = {
val exp: Arbol = Sum(Sum(Var("x"),Var("x")),Sum(Const(7),Var("y")))
val ent: Entonrno = { case "x" => 5 case "y" => 7 }
println("Expresión: " + exp)
@@ -386,7 +386,7 @@ El ejemplo anterior introduce a las variables en Scala, que no deberían requeri
Para utilizar esta clase `Referencia`, uno necesita especificar qué tipo utilizar por el parámetro `T`, es decir, el tipo del elemento contenido por la referencia. Por ejemplo, para crear y utilizar una referencia que contenga un entero, podríamos escribir lo siguiente:
object ReferenciaEntero {
- def main(args: Array[String]) {
+ def main(args: Array[String]): Unit = {
val ref = new Referencia[Int]
ref.set(13)
println("La referencia tiene la mitad de " + (ref.get * 2))
diff --git a/_fr/getting-started/index.md b/_fr/getting-started/install-scala.md
similarity index 84%
rename from _fr/getting-started/index.md
rename to _fr/getting-started/install-scala.md
index f9b05d7df9..76f7c537f9 100644
--- a/_fr/getting-started/index.md
+++ b/_fr/getting-started/install-scala.md
@@ -24,15 +24,46 @@ Nous recommandons l'utilisation de l'outil d'installation "Coursier" qui va auto
### Utilisation de l'installateur Scala (recommandé)
L'installateur Scala est un outil nommé [Coursier](https://get-coursier.io/docs/cli-overview), la commande principale de l'outil est `cs`.
-Il s'assure que la JVM est les outils standards de Scala sont installés sur votre système.
+Il s'assure que la JVM est les outils standards de Scala sont installés sur votre système.
Installez-le sur votre système avec les instructions suivantes.
-
+
+{% tabs install-cs-setup-tabs class=platform-os-options %}
+
+
+{% tab macOS for=install-cs-setup-tabs %}
+{% include code-snippet.html language='bash' codeSnippet=site.data.setup-scala.macOS-brew %}
+{% altDetails cs-setup-macos-nobrew "Alternativement, si vous n'utilisez pas Homebrew:" %}
+ {% include code-snippet.html language='bash' codeSnippet=site.data.setup-scala.macOS-x86-64 %}
+{% endaltDetails %}
+{% endtab %}
+
+
+
+{% tab Linux for=install-cs-setup-tabs %}
+ {% include code-snippet.html language='bash' codeSnippet=site.data.setup-scala.linux-x86-64 %}
+{% endtab %}
+
+
+
+{% tab Windows for=install-cs-setup-tabs %}
+ Téléchargez et exécutez [l'intallateur Scala pour Windows]({{site.data.setup-scala.windows-link}}) basé sur Coursier.
+{% endtab %}
+
+
+
+{% tab Other for=install-cs-setup-tabs defaultTab %}
+
+ Suivez
+ [les instructions pour installer la commande `cs`](https://get-coursier.io/docs/cli-installation)
+ puis exécutez `./cs setup`.
+{% endtab %}
+
+
+{% endtabs %}
+
En plus de gérer les JVMs, `cs setup` installe aussi des utilitaires en ligne de commande :
@@ -157,7 +188,7 @@ Une fois que vous avez terminé le tutoriel ce dessus, vous pouvez consulter :
* [The Scala Book](/scala3/book/introduction.html) ([Lien](/overviews/scala-book/introduction.html) vers la version Scala 2), qui fournit un ensemble de courtes leçons et introduit les fonctionnalités principales de Scala.
* [The Tour of Scala](/tour/tour-of-scala.html) pour une introduction des fonctionnalités Scala.
-* [Learning Resources](/learn.html), qui contient des tutoriels et des cours interactifs.
+* [Learning Courses](/online-courses.html), qui contient des tutoriels et des cours interactifs.
* [Our list of some popular Scala books](/books.html).
* [The migration guide](/scala3/guides/migration/compatibility-intro.html) pour vous aider à migrer votre code Scala 2 vers Scala 3.
@@ -165,30 +196,3 @@ Une fois que vous avez terminé le tutoriel ce dessus, vous pouvez consulter :
Il y a plusieurs listes de diffusion et canaux de discussions instantanés si vous souhaitez rencontrer rapidement d'autres utilisateurs de Scala. Allez faire un tour sur notre page [community](https://scala-lang.org/community/) pour consulter la liste des ces ressources et obtenir de l'aide.
Traduction par Antoine Pointeau.
-
-
-
diff --git a/_fr/tour/automatic-closures.md b/_fr/tour/automatic-closures.md
deleted file mode 100644
index f5a06a5f5f..0000000000
--- a/_fr/tour/automatic-closures.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-layout: tour
-title: Automatic Closures
-partof: scala-tour
-
-language: fr
----
diff --git a/_fr/tour/extractor-objects.md b/_fr/tour/extractor-objects.md
index 9ffc529a58..1f864b7f39 100644
--- a/_fr/tour/extractor-objects.md
+++ b/_fr/tour/extractor-objects.md
@@ -12,13 +12,13 @@ previous-page: regular-expression-patterns
---
Un objet extracteur est un objet avec une méthode `unapply`. Tandis que la méthode `apply` ressemble à un constructeur qui prend des arguments et crée un objet, `unapply` prend un object et essaye de retourner ses arguments. Il est utilisé le plus souvent en filtrage par motif (*pattern matching*) ou avec les fonctions partielles.
-
+
```scala mdoc
import scala.util.Random
object CustomerID {
- def apply(name: String) = s"$name--${Random.nextLong}"
+ def apply(name: String) = s"$name--${Random.nextLong()}"
def unapply(customerID: String): Option[String] = {
val stringArray: Array[String] = customerID.split("--")
@@ -35,7 +35,7 @@ customer1ID match {
La méthode `apply` crée une chaîne de caractères `CustomerID` depuis `name`. La méthode `unapply` fait l'inverse pour retrouver le `name`. Lorsqu'on appelle `CustomerID("Sukyoung")`, c'est un raccourci pour `CustomerID.apply("Sukyoung")`. Lorsqu'on appelle `case CustomerID(name) => println(name)`, on appelle la méthode `unapply` avec `CustomerID.unapply(customer1ID)`.
-Sachant qu'une définition de valeur peut utiliser une décomposition pour introduire une nouvelle variable, un extracteur peut être utilisé pour initialiser la variable, avec la méthode `unapply` pour fournir la valeur.
+Sachant qu'une définition de valeur peut utiliser une décomposition pour introduire une nouvelle variable, un extracteur peut être utilisé pour initialiser la variable, avec la méthode `unapply` pour fournir la valeur.
```scala mdoc
val customer2ID = CustomerID("Nico")
@@ -63,4 +63,4 @@ Le type de retour de `unapply` doit être choisi comme suit :
Parfois, le nombre de valeurs à extraire n'est pas fixe et on souhaiterait retourner un nombre arbitraire de valeurs, en fonction des données d'entrée. Pour ce cas, vous pouvez définir des extracteurs avec la méthode `unapplySeq` qui retourne un `Option[Seq[T]]`. Un exemple commun d'utilisation est la déconstruction d'une liste en utilisant `case List(x, y, z) =>`. Un autre est la décomposition d'une `String` en utilisant une expression régulière `Regex`, comme `case r(name, remainingFields @ _*) =>`.
-Traduit par Antoine Pointeau.
\ No newline at end of file
+Traduit par Antoine Pointeau.
diff --git a/_fr/tour/tour-of-scala.md b/_fr/tour/tour-of-scala.md
index cb9fb2fcc6..f5d0f5d20a 100644
--- a/_fr/tour/tour-of-scala.md
+++ b/_fr/tour/tour-of-scala.md
@@ -14,8 +14,8 @@ Ce tour contient une introduction morceaux par morceaux aux fonctionnalités les
utilisées en Scala. Il est adressé aux novices de Scala.
Ceci est un bref tour du language, non pas un tutoriel complet.
-Si vous recherchez un guide plus détaillé, il est préférable d'opter pour [un livre](/books.html) ou de consulter
-[d'autres ressources](/learn.html).
+Si vous recherchez un guide plus détaillé, il est préférable d'opter pour [un livre](/books.html) ou de suivre
+[un cours en ligne](/online-courses.html).
## Qu'est-ce que le Scala ?
Scala est un langage de programmation à multiples paradigmes désigné pour exprimer des motifs de programmation communs de
diff --git a/_getting-started/index.md b/_getting-started/index.md
deleted file mode 100644
index 03af9270c4..0000000000
--- a/_getting-started/index.md
+++ /dev/null
@@ -1,11 +0,0 @@
----
-layout: singlepage-overview
-title: Getting Started
-partof: getting-started
-languages: [fr, ja]
-includeTOC: true
-
-redirect_from: "/getting-started.html"
----
-
-{% include getting-started.md %}
diff --git a/_glossary/index.md b/_glossary/index.md
index 3eba952f88..9d4d490c65 100644
--- a/_glossary/index.md
+++ b/_glossary/index.md
@@ -16,380 +16,380 @@ languages: [zh-cn]
-* #### algebraic data type
+* ### algebraic data type
A type defined by providing several alternatives, each of which comes with its own constructor. It usually comes with a way to decompose the type through pattern matching. The concept is found in specification languages and functional programming languages. Algebraic data types can be emulated in Scala with case classes.
-* #### alternative
+* ### alternative
A branch of a match expression. It has the form “`case` _pattern_ => _expression_.” Another name for alternative is _case_.
-* #### annotation
+* ### annotation
An annotation appears in source code and is attached to some part of the syntax. Annotations are computer processable, so you can use them to effectively add an extension to Scala.
-* #### anonymous class
+* ### anonymous class
An anonymous class is a synthetic subclass generated by the Scala compiler from a new expression in which the class or trait name is followed by curly braces. The curly braces contains the body of the anonymous subclass, which may be empty. However, if the name following new refers to a trait or class that contains abstract members, these must be made concrete inside the curly braces that define the body of the anonymous subclass.
-* #### anonymous function
+* ### anonymous function
Another name for [function literal](#function-literal).
-* #### apply
+* ### apply
You can apply a method, function, or closure to arguments, which means you invoke it on those arguments.
-* #### argument
+* ### argument
When a function is invoked, an argument is passed for each parameter of that function. The parameter is the variable that refers to the argument. The argument is the object passed at invocation time. In addition, applications can take (command line) arguments that show up in the `Array[String]` passed to main methods of singleton objects.
-* #### assign
+* ### assign
You can assign an object to a variable. Afterwards, the variable will refer to the object.
-* #### auxiliary constructor
+* ### auxiliary constructor
Extra constructors defined inside the curly braces of the class definition, which look like method definitions named `this`, but with no result type.
-* #### block
-One or more expressions and declarations surrounded by curly braces. When the block evaluates, all of its expressions and declarations are processed in order, and then the block returns the value of the last expression as its own value. Blocks are commonly used as the bodies of functions, [for expressions](#for-expression), `while` loops, and any other place where you want to group a number of statements together. More formally, a block is an encapsulation construct for which you can only see side effects and a result value. The curly braces in which you define a class or object do not, therefore, form a block, because fields and methods (which are defined inside those curly braces) are visible from the out- side. Such curly braces form a template.
+* ### block
+One or more expressions and declarations surrounded by curly braces. When the block evaluates, all of its expressions and declarations are processed in order, and then the block returns the value of the last expression as its own value. Blocks are commonly used as the bodies of functions, [for expressions](#for-expression), `while` loops, and any other place where you want to group a number of statements together. More formally, a block is an encapsulation construct for which you can only see side effects and a result value. The curly braces in which you define a class or object do not, therefore, form a block, because fields and methods (which are defined inside those curly braces) are visible from the outside. Such curly braces form a template.
-* #### bound variable
+* ### bound variable
A bound variable of an expression is a variable that’s both used and defined inside the expression. For instance, in the function literal expression `(x: Int) => (x, y)`, both variables `x` and `y` are used, but only `x` is bound, because it is defined in the expression as an `Int` and the sole argument to the function described by the expression.
-* #### by-name parameter
+* ### by-name parameter
A parameter that is marked with a `=>` in front of the parameter type, e.g., `(x: => Int)`. The argument corresponding to a by-name parameter is evaluated not before the method is invoked, but each time the parameter is referenced by name inside the method. If a parameter is not by-name, it is by-value.
-* #### by-value parameter
+* ### by-value parameter
A parameter that is not marked with a `=>` in front of the parameter type, e.g., `(x: Int)`. The argument corresponding to a by-value parameter is evaluated before the method is invoked. By-value parameters contrast with by-name parameters.
-* #### class
+* ### class
Defined with the `class` keyword, a _class_ may either be abstract or concrete, and may be parameterized with types and values when instantiated. In `new Array[String](2)`, the class being instantiated is `Array` and the type of the value that results is `Array[String]`. A class that takes type parameters is called a _type constructor_. A type can be said to have a class as well, as in: the class of type `Array[String]` is `Array`.
-* #### closure
+* ### closure
A function object that captures free variables, and is said to be “closed” over the variables visible at the time it is created.
-* #### companion class
+* ### companion class
A class that shares the same name with a singleton object defined in the same source file. The class is the singleton object’s companion class.
-* #### companion object
+* ### companion object
A singleton object that shares the same name with a class defined in the same source file. Companion objects and classes have access to each other’s private members. In addition, any implicit conversions defined in the companion object will be in scope anywhere the class is used.
-* #### contravariant
+* ### contravariant
A _contravariant_ annotation can be applied to a type parameter of a class or trait by putting a minus sign (-) before the type parameter. The class or trait then subtypes contravariantly with—in the opposite direction as—the type annotated parameter. For example, `Function1` is contravariant in its first type parameter, and so `Function1[Any, Any]` is a subtype of `Function1[String, Any]`.
-* #### covariant
+* ### covariant
A _covariant_ annotation can be applied to a type parameter of a class or trait by putting a plus sign (+) before the type parameter. The class or trait then subtypes covariantly with—in the same direction as—the type annotated parameter. For example, `List` is covariant in its type parameter, so `List[String]` is a subtype of `List[Any]`.
-* #### currying
+* ### currying
A way to write functions with multiple parameter lists. For instance `def f(x: Int)(y: Int)` is a curried function with two parameter lists. A curried function is applied by passing several arguments lists, as in: `f(3)(4)`. However, it is also possible to write a _partial application_ of a curried function, such as `f(3)`.
-* #### declare
+* ### declare
You can _declare_ an abstract field, method, or type, which gives an entity a name but not an implementation. The key difference between declarations and definitions is that definitions establish an implementation for the named entity, declarations do not.
-* #### define
+* ### define
To _define_ something in a Scala program is to give it a name and an implementation. You can define classes, traits, singleton objects, fields, methods, local functions, local variables, _etc_. Because definitions always involve some kind of implementation, abstract members are declared not defined.
-* #### direct subclass
+* ### direct subclass
A class is a _direct subclass_ of its direct superclass.
-* #### direct superclass
+* ### direct superclass
The class from which a class or trait is immediately derived, the nearest class above it in its inheritance hierarchy. If a class `Parent` is mentioned in a class `Child`’s optional extends clause, then `Parent` is the direct superclass of `Child`. If a trait is mentioned in `Child`’s extends clause, the trait’s direct superclass is the `Child`’s direct superclass. If `Child` has no extends clause, then `AnyRef` is the direct superclass of `Child`. If a class’s direct superclass takes type parameters, for example class `Child` extends `Parent[String]`, the direct superclass of `Child` is still `Parent`, not `Parent[String]`. On the other hand, `Parent[String]` would be the direct supertype of `Child`. See [supertype](#supertype) for more discussion of the distinction between class and type.
-* #### equality
+* ### equality
When used without qualification, _equality_ is the relation between values expressed by `==`. See also [reference equality](#reference-equality).
-* #### existential type
+* ### existential type
An existential type includes references to type variables that are unknown. For example, `Array[T] forSome { type T }` is an existential type. It is an array of `T`, where `T` is some completely unknown type. All that is assumed about `T` is that it exists at all. This assumption is weak, but it means at least that an `Array[T] forSome { type T }` is indeed an array and not a banana.
-* #### expression
+* ### expression
Any bit of Scala code that yields a result. You can also say that an expression _evaluates_ to a result or _results_ in a value.
-* #### filter
+* ### filter
An `if` followed by a boolean expression in a [for expression](#for-expression). In `for(i <- 1 to 10; if i % 2 == 0)`, the filter is “`if i % 2 == 0`”. The value to the right of the `if` is the [filter expression](#filter-expression). Also known as a guard.
-* #### filter expression
+* ### filter expression
A _filter expression_ is the boolean expression following an `if` in a [for expression](#for-expression). In `for( i <- 1 to 10 ; if i % 2 == 0)`,the filter expression is “`i % 2 == 0`”.
-* #### first-class function
+* ### first-class function
Scala supports _first-class functions_, which means you can express functions in function literal syntax, i.e., `(x: Int) => x + 1`, and that functions can be represented by objects, which are called [function values](#function-value).
-* #### for comprehension
+* ### for comprehension
A _for comprehension_ is a type of [for expression](#for-expression) that creates a new collection. For each iteration of the `for` comprehension, the [yield](#yield) clause defines an element of the new collection. For example, `for (i <- (0 until 2); j <- (2 until 4)) yield (i, j)` returns the collection `Vector((0,2), (0,3), (1,2), (1,3))`.
-* #### for expression
+* ### for expression
A _for expression_ is either a [for loop](#for-loop), which iterates over one or more collections, or a [for comprehension](#for-comprehension), which builds a new collection from the elements of one or more collections. A `for` expression is built up of [generators](#generator), [filters](#filter), variable definitions, and (in the case of [for comprehensions](#for-comprehension)) a [yield](#yield) clause.
-* #### for loop
+* ### for loop
A _for loop_ is a type of [for expression](#for-expression) that loops over one or more collections. Since `for` loops return unit, they usually produce side-effects. For example, `for (i <- 0 until 100) println(i)` prints the numbers 0 through 99.
-* #### free variable
+* ### free variable
A _free variable_ of an expression is a variable that’s used inside the expression but not defined inside the expression. For instance, in the function literal expression `(x: Int) => (x, y)`, both variables `x` and `y` are used, but only `y` is a free variable, because it is not defined inside the expression.
-* #### function
+* ### function
A _function_ can be [invoked](#invoke) with a list of arguments to produce a result. A function has a parameter list, a body, and a result type. Functions that are members of a class, trait, or singleton object are called [methods](#method). Functions defined inside other functions are called [local functions](#local-function). Functions with the result type of `Unit` are called [procedures](#procedure). Anonymous functions in source code are called [function literals](#function-literal). At run time, function literals are instantiated into objects called [function values](#function-value).
-* #### function literal
+* ### function literal
A function with no name in Scala source code, specified with _function literal_ syntax. For example, `(x: Int, y: Int) => x + y`.
-* #### function value
+* ### function value
A function object that can be invoked just like any other function. A _function value_’s class extends one of the `FunctionN` traits (e.g., `Function0`, `Function1`) from package `scala`, and is usually expressed in source code via [function literal](#function-literal) syntax. A function value is “invoked” when its apply method is called. A function value that captures free variables is a [closure](#closure).
-* #### functional style
+* ### functional style
The _functional style_ of programming emphasizes functions and evaluation results and deemphasizes the order in which operations occur. The style is characterized by passing function values into looping methods, immutable data, methods with no side effects. It is the dominant paradigm of languages such as Haskell and Erlang, and contrasts with the [imperative style](#imperative-style).
-* #### generator
+* ### generator
A _generator_ defines a named val and assigns to it a series of values in a [for expression](#for-expression). For example, in `for(i <- 1 to 10)`, the generator is “`i <- 1 to 10`”. The value to the right of the `<-` is the [generator expression](#generator-expression).
-* #### generator expression
+* ### generator expression
A _generator expression_ generates a series of values in a [for expression](#for-expression). For example, in `for(i <- 1 to 10)`, the generator expression is “`1 to 10`”.
-* #### generic class
+* ### generic class
A class that takes type parameters. For example, because `scala.List` takes a type parameter, `scala.List` is a _generic class_.
-* #### generic trait
+* ### generic trait
A trait that takes type parameters. For example, because trait `scala.collection.Set` takes a type parameter, it is a _generic trait_.
-* #### guard
+* ### guard
See [filter](#filter).
-* #### helper function
+* ### helper function
A function whose purpose is to provide a service to one or more other functions nearby. Helper functions are often implemented as local functions.
-* #### helper method
+* ### helper method
A [helper function](#helper-function) that’s a member of a class. Helper methods are often private.
-* #### immutable
+* ### immutable
An object is _immutable_ if its value cannot be changed after it is created in any way visible to clients. Objects may or may not be immutable.
-* #### imperative style
+* ### imperative style
The _imperative style_ of programming emphasizes careful sequencing of operations so that their effects happen in the right order. The style is characterized by iteration with loops, mutating data in place, and methods with side effects. It is the dominant paradigm of languages such as C, C++, C# and Java, and contrasts with the [functional style](#functional-style).
-* #### initialize
+* ### initialize
When a variable is defined in Scala source code, you must _initialize_ it with an object.
-* #### instance
+* ### instance
An _instance_, or class instance, is an object, a concept that exists only at run time.
-* #### instantiate
+* ### instantiate
To _instantiate_ a class is to make a new object from the class, an action that happens only at run time.
-* #### invariant
+* ### invariant
_Invariant_ is used in two ways. It can mean a property that always holds true when a data structure is well-formed. For example, it is an invariant of a sorted binary tree that each node is ordered before its right subnode, if it has a right subnode. Invariant is also sometimes used as a synonym for nonvariant: “class `Array` is invariant in its type parameter.”
-* #### invoke
+* ### invoke
You can _invoke_ a method, function, or closure _on_ arguments, meaning its body will be executed with the specified arguments.
-* #### JVM
+* ### JVM
The _JVM_ is the Java Virtual Machine, or [runtime](#runtime), that hosts a running Scala program.
-* #### literal
+* ### literal
`1`, `"One"`, and `(x: Int) => x + 1` are examples of _literals_. A literal is a shorthand way to describe an object, where the shorthand exactly mirrors the structure of the created object.
-* #### local function
+* ### local function
A _local function_ is a `def` defined inside a block. To contrast, a `def` defined as a member of a class, trait, or singleton object is called a [method](#method).
-* #### local variable
+* ### local variable
A _local variable_ is a `val` or `var` defined inside a block. Although similar to [local variables](#local-variable), parameters to functions are not referred to as local variables, but simply as parameters or “variables” without the “local.”
-* #### member
+* ### member
A _member_ is any named element of the template of a class, trait, or singleton object. A member may be accessed with the name of its owner, a dot, and its simple name. For example, top-level fields and methods defined in a class are members of that class. A trait defined inside a class is a member of its enclosing class. A type defined with the type keyword in a class is a member of that class. A class is a member of the package in which is it defined. By contrast, a local variable or local function is not a member of its surrounding block.
-* #### message
+* ### message
Actors communicate with each other by sending each other _messages_. Sending a message does not interrupt what the receiver is doing. The receiver can wait until it has finished its current activity and its invariants have been reestablished.
-* #### meta-programming
+* ### meta-programming
Meta-programming software is software whose input is itself software. Compilers are meta-programs, as are tools like `scaladoc`. Meta-programming software is required in order to do anything with an annotation.
-* #### method
+* ### method
A _method_ is a function that is a member of some class, trait, or singleton object.
-* #### mixin
+* ### mixin
_Mixin_ is what a trait is called when it is being used in a mixin composition. In other words, in “`trait Hat`,” `Hat` is just a trait, but in “`new Cat extends AnyRef with Hat`,” `Hat` can be called a mixin. When used as a verb, “mix in” is two words. For example, you can _mix_ traits _in_ to classes or other traits.
-* #### mixin composition
+* ### mixin composition
The process of mixing traits into classes or other traits. _Mixin composition_ differs from traditional multiple inheritance in that the type of the super reference is not known at the point the trait is defined, but rather is determined anew each time the trait is mixed into a class or other trait.
-* #### modifier
+* ### modifier
A keyword that qualifies a class, trait, field, or method definition in some way. For example, the `private` modifier indicates that a class, trait, field, or method being defined is private.
-* #### multiple definitions
+* ### multiple definitions
The same expression can be assigned in _multiple definitions_ if you use the syntax `val v1, v2, v3 = exp`.
-* #### nonvariant
+* ### nonvariant
A type parameter of a class or trait is by default _nonvariant_. The class or trait then does not subtype when that parameter changes. For example, because class `Array` is nonvariant in its type parameter, `Array[String]` is neither a subtype nor a supertype of `Array[Any]`.
-* #### operation
+* ### operation
In Scala, every _operation_ is a method call. Methods may be invoked in _operator notation_, such as `b + 2`, and when in that notation, `+` is an _operator_.
-* #### parameter
+* ### parameter
Functions may take zero to many _parameters_. Each parameter has a name and a type. The distinction between parameters and arguments is that arguments refer to the actual objects passed when a function is invoked. Parameters are the variables that refer to those passed arguments.
-* #### parameterless function
+* ### parameterless function
A function that takes no parameters, which is defined without any empty parentheses. Invocations of parameterless functions may not supply parentheses. This supports the [uniform access principle](#uniform-access-principle), which enables the `def` to be changed into a `val` without requiring a change to client code.
-* #### parameterless method
+* ### parameterless method
A _parameterless method_ is a parameterless function that is a member of a class, trait, or singleton object.
-* #### parametric field
+* ### parametric field
A field defined as a class parameter.
-* #### partially applied function
+* ### partially applied function
A function that’s used in an expression and that misses some of its arguments. For instance, if function `f` has type `Int => Int => Int`, then `f` and `f(1)` are _partially applied functions_.
-* #### path-dependent type
+* ### path-dependent type
A type like `swiss.cow.Food`. The `swiss.cow` part is a path that forms a reference to an object. The meaning of the type is sensitive to the path you use to access it. The types `swiss.cow.Food` and `fish.Food`, for example, are different types.
-* #### pattern
+* ### pattern
In a `match` expression alternative, a _pattern_ follows each `case` keyword and precedes either a _pattern guard_ or the `=>` symbol.
-* #### pattern guard
+* ### pattern guard
In a `match` expression alternative, a _pattern guard_ can follow a [pattern](#pattern). For example, in “`case x if x % 2 == 0 => x + 1`”, the pattern guard is “`if x % 2 == 0`”. A case with a pattern guard will only be selected if the pattern matches and the pattern guard yields true.
-* #### predicate
+* ### predicate
A _predicate_ is a function with a `Boolean` result type.
-* #### primary constructor
+* ### primary constructor
The main constructor of a class, which invokes a superclass constructor, if necessary, initializes fields to passed values, and executes any top-level code defined between the curly braces of the class. Fields are initialized only for value parameters not passed to the superclass constructor, except for any that are not used in the body of the class and can therefore be optimized away.
-* #### procedure
+* ### procedure
A _procedure_ is a function with result type of `Unit`, which is therefore executed solely for its side effects.
-* #### reassignable
+* ### reassignable
A variable may or may not be _reassignable_. A `var` is reassignable while a `val` is not.
-* #### recursive
+* ### recursive
A function is _recursive_ if it calls itself. If the only place the function calls itself is the last expression of the function, then the function is [tail recursive](#tail-recursive).
-* #### reference
+* ### reference
A _reference_ is the Java abstraction of a pointer, which uniquely identifies an object that resides on the JVM’s heap. Reference type variables hold references to objects, because reference types (instances of `AnyRef`) are implemented as Java objects that reside on the JVM’s heap. Value type variables, by contrast, may sometimes hold a reference (to a boxed wrapper type) and sometimes not (when the object is being represented as a primitive value). Speaking generally, a Scala variable [refers](#refers) to an object. The term “refers” is more abstract than “holds a reference.” If a variable of type `scala.Int` is currently represented as a primitive Java `int` value, then that variable still refers to the `Int` object, but no reference is involved.
-* #### reference equality
+* ### reference equality
_Reference equality_ means that two references identify the very same Java object. Reference equality can be determined, for reference types only, by calling `eq` in `AnyRef`. (In Java programs, reference equality can be determined using `==` on Java [reference types](#reference-type).)
-* #### reference type
+* ### reference type
A _reference type_ is a subclass of `AnyRef`. Instances of reference types always reside on the JVM’s heap at run time.
-* #### referential transparency
+* ### referential transparency
A property of functions that are independent of temporal context and have no side effects. For a particular input, an invocation of a referentially transparent function can be replaced by its result without changing the program semantics.
-* #### refers
+* ### refers
A variable in a running Scala program always _refers_ to some object. Even if that variable is assigned to `null`, it conceptually refers to the `Null` object. At runtime, an object may be implemented by a Java object or a value of a primitive type, but Scala allows programmers to think at a higher level of abstraction about their code as they imagine it running. See also [reference](#reference).
-* #### refinement type
+* ### refinement type
A type formed by supplying a base type with a number of members inside curly braces. The members in the curly braces refine the types that are present in the base type. For example, the type of “animal that eats grass” is `Animal { type SuitableFood = Grass }`.
-* #### result
+* ### result
An expression in a Scala program yields a _result_. The result of every expression in Scala is an object.
-* #### result type
+* ### result type
A method’s _result type_ is the type of the value that results from calling the method. (In Java, this concept is called the return type.)
-* #### return
+* ### return
A function in a Scala program _returns_ a value. You can call this value the [result](#result) of the function. You can also say the function _results in_ the value. The result of every function in Scala is an object.
-* #### runtime
+* ### runtime
The Java Virtual Machine, or [JVM](#jvm), that hosts a running Scala program. Runtime encompasses both the virtual machine, as defined by the Java Virtual Machine Specification, and the runtime libraries of the Java API and the standard Scala API. The phrase at run time (with a space between run and time) means when the program is running, and contrasts with compile time.
-* #### runtime type
+* ### runtime type
The type of an object at run time. To contrast, a [static type](#static-type) is the type of an expression at compile time. Most runtime types are simply bare classes with no type parameters. For example, the runtime type of `"Hi"` is `String`, and the runtime type of `(x: Int) => x + 1` is `Function1`. Runtime types can be tested with `isInstanceOf`.
-* #### script
+* ### script
A file containing top level definitions and statements, which can be run directly with `scala` without explicitly compiling. A script must end in an expression, not a definition.
-* #### selector
+* ### selector
The value being matched on in a `match` expression. For example, in “`s match { case _ => }`”, the selector is `s`.
-* #### self type
+* ### self type
A _self type_ of a trait is the assumed type of `this`, the receiver, to be used within the trait. Any concrete class that mixes in the trait must ensure that its type conforms to the trait’s self type. The most common use of self types is for dividing a large class into several traits (as described in Chapter 29 of [Programming in Scala](https://www.artima.com/shop/programming_in_scala)).
-* #### semi-structured data
+* ### semi-structured data
XML data is semi-structured. It is more structured than a flat binary file or text file, but it does not have the full structure of a programming language’s data structures.
-* #### serialization
-You can _serialize_ an object into a byte stream which can then be saved to files or transmitted over the network. You can later _deserialize_ the byte stream, even on different computer, and obtain an object that is the same as the original serialized object.
+* ### serialization
+You can _serialize_ an object into a byte stream which can then be saved to a file or transmitted over the network. You can later _deserialize_ the byte stream, even on different computer, and obtain an object that is the same as the original serialized object.
-* #### shadow
+* ### shadow
A new declaration of a local variable _shadows_ one of the same name in an enclosing scope.
-* #### signature
+* ### signature
_Signature_ is short for [type signature](#type-signature).
-* #### singleton object
+* ### singleton object
An object defined with the object keyword. Each singleton object has one and only one instance. A singleton object that shares its name with a class, and is defined in the same source file as that class, is that class’s [companion object](#companion-object). The class is its [companion class](#companion-class). A singleton object that doesn’t have a companion class is a [standalone object](#standalone-object).
-* #### standalone object
+* ### standalone object
A [singleton object](#singleton-object) that has no [companion class](#companion-class).
-* #### statement
+* ### statement
An expression, definition, or import, _i.e._, things that can go into a template or a block in Scala source code.
-* #### static type
+* ### static type
See [type](#type).
-* #### structural type
+* ### structural type
A [refinement type](#refinement-type) where the refinements are for members not in the base type. For example, `{ def close(): Unit }` is a structural type, because the base type is `AnyRef`, and `AnyRef` does not have a member named `close`.
-* #### subclass
+* ### subclass
A class is a _subclass_ of all of its [superclasses](#superclass) and [supertraits](#supertrait).
-* #### subtrait
+* ### subtrait
A trait is a _subtrait_ of all of its [supertraits](#supertrait).
-* #### subtype
+* ### subtype
The Scala compiler will allow any of a type’s _subtypes_ to be used as a substitute wherever that type is required. For classes and traits that take no type parameters, the subtype relationship mirrors the subclass relationship. For example, if class `Cat` is a subclass of abstract class `Animal`, and neither takes type parameters, type `Cat` is a subtype of type `Animal`. Likewise, if trait `Apple` is a subtrait of trait `Fruit`, and neither takes type parameters, type `Apple` is a subtype of type `Fruit`. For classes and traits that take type parameters, however, variance comes into play. For example, because abstract class `List` is declared to be covariant in its lone type parameter (i.e., `List` is declared `List[+A]`), `List[Cat]` is a subtype of `List[Animal]`, and `List[Apple]` a subtype of `List[Fruit]`. These subtype relationships exist even though the class of each of these types is `List`. By contrast, because `Set` is not declared to be covariant in its type parameter (i.e., `Set` is declared `Set[A]` with no plus sign), `Set[Cat]` is not a subtype of `Set[Animal]`. A subtype should correctly implement the contracts of its supertypes, so that the Liskov Substitution Principle applies, but the compiler only verifies this property at the level of type checking.
-* #### superclass
+* ### superclass
A class’s _superclasses_ include its direct superclass, its direct superclass’s direct superclass, and so on, all the way up to `Any`.
-* #### supertrait
+* ### supertrait
A class’s or trait’s _supertraits_, if any, include all traits directly mixed into the class or trait or any of its superclasses, plus any supertraits of those traits.
-* #### supertype
+* ### supertype
A type is a _supertype_ of all of its subtypes.
-* #### synthetic class
+* ### synthetic class
A synthetic class is generated automatically by the compiler rather than being written by hand by the programmer.
-* #### tail recursive
+* ### tail recursive
A function is _tail recursive_ if the only place the function calls itself is the last operation of the function.
-* #### target typing
+* ### target typing
_Target typing_ is a form of type inference that takes into account the type that’s expected. In `nums.filter((x) => x > 0)`, for example, the Scala compiler infers type of `x` to be the element type of `nums`, because the `filter` method invokes the function on each element of `nums`.
-* #### template
+* ### template
A _template_ is the body of a class, trait, or singleton object definition. It defines the type signature, behavior and initial state of the class, trait, or object.
-* #### trait
+* ### trait
A _trait_, which is defined with the `trait` keyword, is like an abstract class that cannot take any value parameters and can be “mixed into” classes or other traits via the process known as [mixin composition](#mixin-composition). When a trait is being mixed into a class or trait, it is called a [mixin](#mixin). A trait may be parameterized with one or more types. When parameterized with types, the trait constructs a type. For example, `Set` is a trait that takes a single type parameter, whereas `Set[Int]` is a type. Also, `Set` is said to be “the trait of” type `Set[Int]`.
-* #### type
+* ### type
Every variable and expression in a Scala program has a _type_ that is known at compile time. A type restricts the possible values to which a variable can refer, or an expression can produce, at run time. A variable or expression’s type can also be referred to as a _static type_ if necessary to differentiate it from an object’s [runtime type](#runtime-type). In other words, “type” by itself means static type. Type is distinct from class because a class that takes type parameters can construct many types. For example, `List` is a class, but not a type. `List[T]` is a type with a free type parameter. `List[Int]` and `List[String]` are also types (called ground types because they have no free type parameters). A type can have a “[class](#class)” or “[trait](#trait).” For example, the class of type `List[Int]` is `List`. The trait of type `Set[String]` is `Set`.
-* #### type constraint
+* ### type constraint
Some [annotations](#annotation) are _type constraints_, meaning that they add additional limits, or constraints, on what values the type includes. For example, `@positive` could be a type constraint on the type `Int`, limiting the type of 32-bit integers down to those that are positive. Type constraints are not checked by the standard Scala compiler, but must instead be checked by an extra tool or by a compiler plugin.
-* #### type constructor
+* ### type constructor
A class or trait that takes type parameters.
-* #### type parameter
+* ### type parameter
A parameter to a generic class or generic method that must be filled in by a type. For example, class `List` is defined as “`class List[T] { . . . `”, and method `identity`, a member of object `Predef`, is defined as “`def identity[T](x:T) = x`”. The `T` in both cases is a type parameter.
-* #### type signature
+* ### type signature
A method’s _type signature_ comprises its name, the number, order, and types of its parameters, if any, and its result type. The type signature of a class, trait, or singleton object comprises its name, the type signatures of all of its members and constructors, and its declared inheritance and mixin relations.
-* #### uniform access principle
+* ### uniform access principle
The _uniform access principle_ states that variables and parameterless functions should be accessed using the same syntax. Scala supports this principle by not allowing parentheses to be placed at call sites of parameterless functions. As a result, a parameterless function definition can be changed to a `val`, or _vice versa_, without affecting client code.
-* #### unreachable
+* ### unreachable
At the Scala level, objects can become _unreachable_, at which point the memory they occupy may be reclaimed by the runtime. Unreachable does not necessarily mean unreferenced. Reference types (instances of `AnyRef`) are implemented as objects that reside on the JVM’s heap. When an instance of a reference type becomes unreachable, it indeed becomes unreferenced, and is available for garbage collection. Value types (instances of `AnyVal`) are implemented as both primitive type values and as instances of Java wrapper types (such as `java.lang.Integer`), which reside on the heap. Value type instances can be boxed (converted from a primitive value to a wrapper object) and unboxed (converted from a wrapper object to a primitive value) throughout the lifetime of the variables that refer to them. If a value type instance currently represented as a wrapper object on the JVM’s heap becomes unreachable, it indeed becomes unreferenced, and is available for garbage collection. But if a value type currently represented as a primitive value becomes unreachable, then it does not become unreferenced, because it does not exist as an object on the JVM’s heap at that point of time. The runtime may reclaim memory occupied by unreachable objects, but if an Int, for example, is implemented at run time by a primitive Java int that occupies some memory in the stack frame of an executing method, then the memory for that object is “reclaimed” when the stack frame is popped as the method completes. Memory for reference types, such as `Strings`, may be reclaimed by the JVM’s garbage collector after they become unreachable.
-* #### unreferenced
+* ### unreferenced
See [unreachable](#unreachable).
-* #### value
+* ### value
The result of any computation or expression in Scala is a _value_, and in Scala, every value is an object. The term value essentially means the image of an object in memory (on the JVM’s heap or stack).
-* #### value type
+* ### value type
A _value type_ is any subclass of `AnyVal`, such as `Int`, `Double`, or `Unit`. This term has meaning at the level of Scala source code. At runtime, instances of value types that correspond to Java primitive types may be implemented in terms of primitive type values or instances of wrapper types, such as `java.lang.Integer`. Over the lifetime of a value type instance, the runtime may transform it back and forth between primitive and wrapper types (_i.e._, to box and unbox it).
-* #### variable
+* ### variable
A named entity that refers to an object. A variable is either a `val` or a `var`. Both `val`s and `var`s must be initialized when defined, but only `var`s can be later reassigned to refer to a different object.
-* #### variance
+* ### variance
A type parameter of a class or trait can be marked with a _variance_ annotation, either [covariant](#covariant) (+) or [contravariant](#contravariant) (-). Such variance annotations indicate how subtyping works for a generic class or trait. For example, the generic class `List` is covariant in its type parameter, and thus `List[String]` is a subtype of `List[Any]`. By default, _i.e._, absent a `+` or `-` annotation, type parameters are [nonvariant](#nonvariant).
-* #### yield
+* ### yield
An expression can _yield_ a result. The `yield` keyword designates the result of a [for comprehension](#for-comprehension).
diff --git a/_includes/_markdown/_ru/install-cask.md b/_includes/_markdown/_ru/install-cask.md
new file mode 100644
index 0000000000..1cac104c20
--- /dev/null
+++ b/_includes/_markdown/_ru/install-cask.md
@@ -0,0 +1,45 @@
+{% altDetails require-info-box 'Установка Cask' %}
+
+{% tabs cask-install class=tabs-build-tool %}
+
+{% tab 'Scala CLI' %}
+
+Вы можете объявить зависимость от Cask с помощью следующей директивы `using`:
+
+```scala
+//> using dep com.lihaoyi::cask::0.10.2
+```
+
+{% endtab %}
+
+{% tab 'sbt' %}
+
+В файле `build.sbt` вы можете добавить зависимость от Cask:
+
+```scala
+lazy val example = project.in(file("example"))
+ .settings(
+ scalaVersion := "3.4.2",
+ libraryDependencies += "com.lihaoyi" %% "cask" % "0.10.2",
+ fork := true
+ )
+```
+
+{% endtab %}
+
+{% tab 'Mill' %}
+
+В файле `build.sc` вы можете добавить зависимость от Cask:
+
+```scala
+object example extends RootModule with ScalaModule {
+ def scalaVersion = "3.4.2"
+ def ivyDeps = Agg(
+ ivy"com.lihaoyi::cask::0.10.2"
+ )
+}
+```
+{% endtab %}
+
+{% endtabs %}
+{% endaltDetails %}
diff --git a/_includes/_markdown/_ru/install-munit.md b/_includes/_markdown/_ru/install-munit.md
new file mode 100644
index 0000000000..aa15142558
--- /dev/null
+++ b/_includes/_markdown/_ru/install-munit.md
@@ -0,0 +1,68 @@
+{% altDetails install-info-box 'Установка MUnit' %}
+
+{% tabs munit-unit-test-1 class=tabs-build-tool %}
+{% tab 'Scala CLI' %}
+
+Вы можете запросить весь набор инструментов одной командой:
+
+```scala
+//> using toolkit latest
+```
+
+MUnit, будучи тестовым фреймворком, доступен только в тестовых файлах:
+файлах в каталоге `test` или тех, которые имеют расширение `.test.scala`.
+Подробнее о тестовой области (test scope) см. [в документации Scala CLI](https://scala-cli.virtuslab.org/docs/commands/test/).
+
+В качестве альтернативы вы можете запросить только определенную версию MUnit:
+
+```scala
+//> using dep org.scalameta::munit:1.1.0
+```
+
+{% endtab %}
+
+{% tab 'sbt' %}
+
+В файле `build.sbt` вы можете добавить зависимость от toolkit-test:
+
+```scala
+lazy val example = project.in(file("."))
+ .settings(
+ scalaVersion := "3.4.2",
+ libraryDependencies += "org.scala-lang" %% "toolkit-test" % "0.7.0" % Test
+ )
+```
+
+Здесь конфигурация `Test` означает, что зависимость используется только исходными файлами в `src/test`.
+
+В качестве альтернативы вы можете запросить только определенную версию MUnit:
+
+```scala
+libraryDependencies += "org.scalameta" %% "munit" % "1.1.0" % Test
+```
+{% endtab %}
+
+{% tab 'Mill' %}
+
+В файле `build.sc` вы можете добавить объект `test`, расширяющий `Tests` и `TestModule.Munit`:
+
+```scala
+object example extends ScalaModule {
+ def scalaVersion = "3.4.2"
+ object test extends Tests with TestModule.Munit {
+ def ivyDeps =
+ Agg(
+ ivy"org.scala-lang::toolkit-test:0.7.0"
+ )
+ }
+}
+```
+
+В качестве альтернативы вы можете запросить только определенную версию MUnit:
+
+```scala
+ivy"org.scalameta::munit:1.1.0"
+```
+{% endtab %}
+{% endtabs %}
+{% endaltDetails %}
\ No newline at end of file
diff --git a/_includes/_markdown/_ru/install-os-lib.md b/_includes/_markdown/_ru/install-os-lib.md
new file mode 100644
index 0000000000..f010d1f7fd
--- /dev/null
+++ b/_includes/_markdown/_ru/install-os-lib.md
@@ -0,0 +1,64 @@
+{% altDetails require-info-box 'Установка OS-Lib' %}
+
+{% tabs oslib-install class=tabs-build-tool %}
+
+{% tab 'Scala CLI' %}
+
+Вы можете запросить весь набор инструментов одной командой:
+
+```scala
+//> using toolkit latest
+```
+
+В качестве альтернативы вы можете запросить только определенную версию OS-Lib:
+
+```scala
+//> using dep com.lihaoyi::os-lib:0.11.3
+```
+
+{% endtab %}
+
+{% tab 'sbt' %}
+
+В файле `build.sbt` вы можете добавить зависимость от `toolkit`:
+
+```scala
+lazy val example = project.in(file("."))
+ .settings(
+ scalaVersion := "3.4.2",
+ libraryDependencies += "org.scala-lang" %% "toolkit" % "0.7.0"
+ )
+```
+
+В качестве альтернативы вы можете запросить только определенную версию OS-Lib:
+
+```scala
+libraryDependencies += "com.lihaoyi" %% "os-lib" % "0.11.3"
+```
+
+{% endtab %}
+
+{% tab 'Mill' %}
+
+В файле `build.sc` вы можете добавить зависимость от `toolkit`:
+
+```scala
+object example extends ScalaModule {
+ def scalaVersion = "3.4.2"
+ def ivyDeps =
+ Agg(
+ ivy"org.scala-lang::toolkit:0.7.0"
+ )
+}
+```
+
+В качестве альтернативы вы можете запросить только определенную версию OS-Lib:
+
+```scala
+ivy"com.lihaoyi::os-lib:0.11.3"
+```
+
+{% endtab %}
+
+{% endtabs %}
+{% endaltDetails %}
\ No newline at end of file
diff --git a/_includes/_markdown/_ru/install-sttp.md b/_includes/_markdown/_ru/install-sttp.md
new file mode 100644
index 0000000000..fec7938cea
--- /dev/null
+++ b/_includes/_markdown/_ru/install-sttp.md
@@ -0,0 +1,64 @@
+
+{% altDetails install-info-box 'Установка sttp' %}
+
+{% tabs sttp-install-methods class=tabs-build-tool%}
+
+{% tab 'Scala CLI' %}
+
+Вы можете запросить весь набор инструментов одной командой:
+
+```scala
+//> using toolkit latest
+```
+
+В качестве альтернативы вы можете запросить только определенную версию sttp:
+
+```scala
+//> using dep com.softwaremill.sttp.client4::core:4.0.0-RC1
+```
+
+{% endtab %}
+
+{% tab 'sbt' %}
+
+В файле `build.sbt` вы можете добавить зависимость от `toolkit`:
+
+```scala
+lazy val example = project.in(file("."))
+ .settings(
+ scalaVersion := "3.4.2",
+ libraryDependencies += "org.scala-lang" %% "toolkit" % "0.7.0"
+ )
+```
+
+В качестве альтернативы вы можете запросить только определенную версию sttp:
+
+```scala
+libraryDependencies += "com.softwaremill.sttp.client4" %% "core" % "4.0.0-RC1"
+```
+
+{% endtab %}
+
+{% tab 'Mill' %}
+
+В файле `build.sc` вы можете добавить зависимость от `toolkit`:
+
+```scala
+object example extends ScalaModule {
+ def scalaVersion = "3.4.2"
+ def ivyDeps =
+ Agg(
+ ivy"org.scala-lang::toolkit:0.7.0"
+ )
+}
+```
+
+В качестве альтернативы вы можете запросить только определенную версию sttp:
+
+```scala
+ivy"com.softwaremill.sttp.client4::core:4.0.0-RC1"
+```
+
+{% endtab %}
+{% endtabs %}
+{% endaltDetails %}
diff --git a/_includes/_markdown/_ru/install-upickle.md b/_includes/_markdown/_ru/install-upickle.md
new file mode 100644
index 0000000000..83880a91a8
--- /dev/null
+++ b/_includes/_markdown/_ru/install-upickle.md
@@ -0,0 +1,64 @@
+
+{% altDetails install-info-box 'Установка upickle' %}
+
+{% tabs upickle-install-methods class=tabs-build-tool %}
+
+{% tab 'Scala CLI' %}
+
+Вы можете запросить весь набор инструментов одной командой:
+
+```scala
+//> using toolkit latest
+```
+
+В качестве альтернативы вы можете запросить только определенную версию UPickle:
+
+```scala
+//> using dep com.lihaoyi::upickle:4.1.0
+```
+
+{% endtab %}
+
+{% tab 'sbt' %}
+
+В файле `build.sbt` вы можете добавить зависимость от `toolkit`:
+
+```scala
+lazy val example = project.in(file("."))
+ .settings(
+ scalaVersion := "3.4.2",
+ libraryDependencies += "org.scala-lang" %% "toolkit" % "0.7.0"
+ )
+```
+
+В качестве альтернативы вы можете запросить только определенную версию UPickle:
+
+```scala
+libraryDependencies += "com.lihaoyi" %% "upickle" % "4.1.0"
+```
+
+{% endtab %}
+
+{% tab 'Mill' %}
+
+В файле `build.sc` вы можете добавить зависимость от `toolkit`:
+
+```scala
+object example extends ScalaModule {
+ def scalaVersion = "3.4.2"
+ def ivyDeps =
+ Agg(
+ ivy"org.scala-lang::toolkit:0.7.0"
+ )
+}
+```
+
+В качестве альтернативы вы можете запросить только определенную версию UPickle:
+
+```scala
+ivy"com.lihaoyi::upickle:4.1.0"
+```
+
+{% endtab %}
+{% endtabs %}
+{% endaltDetails %}
diff --git a/_includes/_markdown/courses-coursera.md b/_includes/_markdown/courses-coursera.md
new file mode 100644
index 0000000000..403c5e3100
--- /dev/null
+++ b/_includes/_markdown/courses-coursera.md
@@ -0,0 +1,18 @@
+## Scala Courses on Coursera by EPFL
+
+The [Scala Center](https://scala.epfl.ch) at EPFL offers free online courses of various levels, from beginner to advanced.
+
+For beginners:
+
+- [Effective Programming in Scala](https://www.coursera.org/learn/effective-scala): a practical introduction to Scala for professional developers
+- [Functional Programming Principles in Scala](https://www.coursera.org/learn/scala-functional-programming): the foundational course by Martin Odersky, Scala's creator
+
+More advanced topics:
+
+- [Functional Program Design in Scala](https://www.coursera.org/learn/scala-functional-program-design): builds on functional principles with more advanced concepts
+- [Parallel Programming](https://www.coursera.org/learn/scala-parallel-programming)
+- [Big Data Analysis with Scala and Spark](https://www.coursera.org/learn/scala-spark-big-data)
+- [Programming Reactive Systems](https://www.coursera.org/learn/scala-akka-reactive): introduces Akka, actors and reactive streams
+
+All courses are free to audit, with an option to pay for a certificate, to showcase your skills on your resume or LinkedIn.
+For more on Scala Center's online courses, visit [this page](https://docs.scala-lang.org/online-courses.html#learning-platforms).
diff --git a/_includes/_markdown/courses-extension-school.md b/_includes/_markdown/courses-extension-school.md
new file mode 100644
index 0000000000..003c42a4f2
--- /dev/null
+++ b/_includes/_markdown/courses-extension-school.md
@@ -0,0 +1,9 @@
+## EPFL Extension School: Effective Programming in Scala
+
+Subscribing to [Effective programming in Scala](https://www.epfl.ch/education/continuing-education/effective-programming-in-scala/) on the EPFL Extension School offers:
+
+- Regular Q&A sessions and code reviews with experts from the Scala team
+- An [Extension School certificate](https://www.epfl.ch/education/continuing-education/certifications/) upon completion
+
+This course combines video lessons, written content and hands-on exercise focused on practical aspects, including business domain modeling, error handling, data manipulation, and task parallelization.
+For more on Scala Center's online courses, visit [this page](https://docs.scala-lang.org/online-courses.html#learning-platforms).
diff --git a/_includes/_markdown/courses-rock-the-jvm.md b/_includes/_markdown/courses-rock-the-jvm.md
new file mode 100644
index 0000000000..0b0db4f9f1
--- /dev/null
+++ b/_includes/_markdown/courses-rock-the-jvm.md
@@ -0,0 +1,17 @@
+## Rock the JVM Courses
+
+_As part of a partnership with the Scala Center, Rock the JVM donates 30% of the revenue from any courses purchased through the links in this section to support the Scala Center._
+
+[Rock the JVM](https://rockthejvm.com?affcode=256201_r93i1xuv) is a learning platform with free and premium courses on the Scala language, and all major libraries and tools in the Scala ecosystem: Typelevel, Zio, Akka/Pekko, Spark, and others.
+Its main Scala courses are:
+
+- [Scala at Light Speed](https://rockthejvm.com/courses/scala-at-light-speed?affcode=256201_r93i1xuv) (free)
+- [Scala & Functional Programming Essentials](https://rockthejvm.com/courses/scala-essentials?affcode=256201_r93i1xuv) (premium)
+- [Advanced Scala and Functional Programming](https://rockthejvm.com/courses/advanced-scala?affcode=256201_r93i1xuv) (premium)
+- [Scala Macros & Metaprogramming](https://rockthejvm.com/courses/scala-macros-and-metaprogramming?affcode=256201_r93i1xuv) (premium)
+
+Other courses teach how to build full-stack Scala applications, using [Typelevel](https://rockthejvm.com/courses/typelevel-rite-of-passage?affcode=256201_r93i1xuv) or [ZIO](https://rockthejvm.com/courses/zio-rite-of-passage?affcode=256201_r93i1xuv) ecosystems.
+
+
+
+Explore more premium [courses](https://rockthejvm.com/courses?affcode=256201_r93i1xuv) or check out [free video tutorials](https://youtube.com/rockthejvm?affcode=256201_r93i1xuv) and [free articles](https://rockthejvm.com/articles?affcode=256201_r93i1xuv).
diff --git a/_includes/_markdown/install-cask.md b/_includes/_markdown/install-cask.md
new file mode 100644
index 0000000000..3637ddfac9
--- /dev/null
+++ b/_includes/_markdown/install-cask.md
@@ -0,0 +1,37 @@
+{% altDetails require-info-box 'Getting Cask' %}
+
+{% tabs cask-install class=tabs-build-tool %}
+
+{% tab 'Scala CLI' %}
+You can declare a dependency on Cask with the following `using` directive:
+```scala
+//> using dep com.lihaoyi::cask::0.10.2
+```
+{% endtab %}
+
+{% tab 'sbt' %}
+In your `build.sbt`, you can add a dependency on Cask:
+```scala
+lazy val example = project.in(file("example"))
+ .settings(
+ scalaVersion := "3.4.2",
+ libraryDependencies += "com.lihaoyi" %% "cask" % "0.10.2",
+ fork := true
+ )
+```
+{% endtab %}
+
+{% tab 'Mill' %}
+In your `build.sc`, you can add a dependency on Cask:
+```scala
+object example extends RootModule with ScalaModule {
+ def scalaVersion = "3.4.2"
+ def ivyDeps = Agg(
+ ivy"com.lihaoyi::cask::0.10.2"
+ )
+}
+```
+{% endtab %}
+
+{% endtabs %}
+{% endaltDetails %}
diff --git a/_includes/_markdown/install-munit.md b/_includes/_markdown/install-munit.md
new file mode 100644
index 0000000000..47eeb1509f
--- /dev/null
+++ b/_includes/_markdown/install-munit.md
@@ -0,0 +1,53 @@
+{% altDetails install-info-box 'Getting MUnit' %}
+
+{% tabs munit-unit-test-1 class=tabs-build-tool %}
+{% tab 'Scala CLI' %}
+You can require the entire toolkit in a single line:
+```scala
+//> using toolkit latest
+```
+MUnit, being a testing framework, is only available in test files: files in a `test` directory or ones that have the `.test.scala` extension. Refer to the [Scala CLI documentation](https://scala-cli.virtuslab.org/docs/commands/test/) to learn more about the test scope.
+
+Alternatively, you can require just a specific version of MUnit:
+```scala
+//> using dep org.scalameta::munit:1.1.0
+```
+{% endtab %}
+{% tab 'sbt' %}
+In your build.sbt file, you can add the dependency on toolkit-test:
+```scala
+lazy val example = project.in(file("."))
+ .settings(
+ scalaVersion := "3.4.2",
+ libraryDependencies += "org.scala-lang" %% "toolkit-test" % "0.7.0" % Test
+ )
+```
+
+Here the `Test` configuration means that the dependency is only used by the source files in `src/test`.
+
+Alternatively, you can require just a specific version of MUnit:
+```scala
+libraryDependencies += "org.scalameta" %% "munit" % "1.1.0" % Test
+```
+{% endtab %}
+{% tab 'Mill' %}
+In your build.sc file, you can add a `test` object extending `Tests` and `TestModule.Munit`:
+```scala
+object example extends ScalaModule {
+ def scalaVersion = "3.4.2"
+ object test extends Tests with TestModule.Munit {
+ def ivyDeps =
+ Agg(
+ ivy"org.scala-lang::toolkit-test:0.7.0"
+ )
+ }
+}
+```
+
+Alternatively, you can require just a specific version of MUnit:
+```scala
+ivy"org.scalameta::munit:1.1.0"
+```
+{% endtab %}
+{% endtabs %}
+{% endaltDetails %}
diff --git a/_includes/_markdown/install-os-lib.md b/_includes/_markdown/install-os-lib.md
new file mode 100644
index 0000000000..ae254d9d71
--- /dev/null
+++ b/_includes/_markdown/install-os-lib.md
@@ -0,0 +1,46 @@
+{% altDetails require-info-box 'Getting OS-Lib' %}
+
+{% tabs oslib-install class=tabs-build-tool %}
+{% tab 'Scala CLI' %}
+You can require the entire toolkit in a single line:
+```scala
+//> using toolkit latest
+```
+
+Alternatively, you can require just a specific version of OS-Lib:
+```scala
+//> using dep com.lihaoyi::os-lib:0.11.3
+```
+{% endtab %}
+{% tab 'sbt' %}
+In your `build.sbt`, you can add a dependency on the toolkit:
+```scala
+lazy val example = project.in(file("."))
+ .settings(
+ scalaVersion := "3.4.2",
+ libraryDependencies += "org.scala-lang" %% "toolkit" % "0.7.0"
+ )
+```
+Alternatively, you can require just a specific version of OS-Lib:
+```scala
+libraryDependencies += "com.lihaoyi" %% "os-lib" % "0.11.3"
+```
+{% endtab %}
+{% tab 'Mill' %}
+In your `build.sc` file, you can add a dependency on the Toolkit:
+```scala
+object example extends ScalaModule {
+ def scalaVersion = "3.4.2"
+ def ivyDeps =
+ Agg(
+ ivy"org.scala-lang::toolkit:0.7.0"
+ )
+}
+```
+Alternatively, you can require just a specific version of OS-Lib:
+```scala
+ivy"com.lihaoyi::os-lib:0.11.3"
+```
+{% endtab %}
+{% endtabs %}
+{% endaltDetails %}
diff --git a/_includes/_markdown/install-sttp.md b/_includes/_markdown/install-sttp.md
new file mode 100644
index 0000000000..0173ec47e1
--- /dev/null
+++ b/_includes/_markdown/install-sttp.md
@@ -0,0 +1,47 @@
+{% altDetails install-info-box 'Getting sttp' %}
+
+{% tabs sttp-install-methods class=tabs-build-tool%}
+{% tab 'Scala CLI' %}
+You can require the entire toolkit in a single line:
+```scala
+//> using toolkit latest
+```
+
+Alternatively, you can require just a specific version of sttp:
+```scala
+//> using dep com.softwaremill.sttp.client4::core:4.0.0-RC1
+```
+{% endtab %}
+{% tab 'sbt' %}
+In your build.sbt file, you can add a dependency on the Toolkit:
+```scala
+lazy val example = project.in(file("."))
+ .settings(
+ scalaVersion := "3.4.2",
+ libraryDependencies += "org.scala-lang" %% "toolkit" % "0.7.0"
+ )
+```
+
+Alternatively, you can require just a specific version of sttp:
+```scala
+libraryDependencies += "com.softwaremill.sttp.client4" %% "core" % "4.0.0-RC1"
+```
+{% endtab %}
+{% tab 'Mill' %}
+In your build.sc file, you can add a dependency on the Toolkit:
+```scala
+object example extends ScalaModule {
+ def scalaVersion = "3.4.2"
+ def ivyDeps =
+ Agg(
+ ivy"org.scala-lang::toolkit:0.7.0"
+ )
+}
+```
+Alternatively, you can require just a specific version of sttp:
+```scala
+ivy"com.softwaremill.sttp.client4::core:4.0.0-RC1"
+```
+{% endtab %}
+{% endtabs %}
+{% endaltDetails %}
diff --git a/_includes/_markdown/install-upickle.md b/_includes/_markdown/install-upickle.md
new file mode 100644
index 0000000000..9f9cff8a62
--- /dev/null
+++ b/_includes/_markdown/install-upickle.md
@@ -0,0 +1,46 @@
+{% altDetails install-info-box 'Getting upickle' %}
+
+{% tabs upickle-install-methods class=tabs-build-tool %}
+{% tab 'Scala CLI' %}
+Using Scala CLI, you can require the entire toolkit in a single line:
+```scala
+//> using toolkit latest
+```
+
+Alternatively, you can require just a specific version of UPickle:
+```scala
+//> using dep com.lihaoyi::upickle:4.1.0
+```
+{% endtab %}
+{% tab 'sbt' %}
+In your build.sbt file, you can add the dependency on the Toolkit:
+```scala
+lazy val example = project.in(file("."))
+ .settings(
+ scalaVersion := "3.4.2",
+ libraryDependencies += "org.scala-lang" %% "toolkit" % "0.7.0"
+ )
+```
+Alternatively, you can require just a specific version of UPickle:
+```scala
+libraryDependencies += "com.lihaoyi" %% "upickle" % "4.1.0"
+```
+{% endtab %}
+{% tab 'Mill' %}
+In your build.sc file, you can add the dependency to the upickle library:
+```scala
+object example extends ScalaModule {
+ def scalaVersion = "3.4.2"
+ def ivyDeps =
+ Agg(
+ ivy"org.scala-lang::toolkit:0.7.0"
+ )
+}
+```
+Alternatively, you can require just a specific version of UPickle:
+```scala
+ivy"com.lihaoyi::upickle:4.1.0"
+```
+{% endtab %}
+{% endtabs %}
+{% endaltDetails %}
diff --git a/_includes/alert-banner.html b/_includes/alert-banner.html
new file mode 100644
index 0000000000..94c5ac1273
--- /dev/null
+++ b/_includes/alert-banner.html
@@ -0,0 +1,10 @@
+{% comment %}use the variable 'message' to include markdown text to display in the alert.{% endcomment %}
+
+{% unless include.message_id == 'disabled' %}
+
+
diff --git a/_includes/column-list-of-items.html b/_includes/column-list-of-items.html
deleted file mode 100644
index 2ce303e678..0000000000
--- a/_includes/column-list-of-items.html
+++ /dev/null
@@ -1,18 +0,0 @@
-{% comment %}
- Layouts using this include should pass an include variable called 'collection' referencing a collection carrying the data (i.e.: contribute_community_tickets, contribute_resources...)
-{% endcomment %}
-
diff --git a/_includes/footer.html b/_includes/footer.html
index a9e18083ff..82d0ba252d 100644
--- a/_includes/footer.html
+++ b/_includes/footer.html
@@ -39,9 +39,9 @@
-
-
-
+
+
+
@@ -53,6 +53,9 @@
+
+
+
@@ -106,7 +109,7 @@
apiKey: 'fbc439670f5d4e3730cdcb715c359391',
indexName: 'scala-lang',
inputSelector: '#doc-search-bar',
- algoliaOptions: { 'facetFilters': ["language:en"] },
+ algoliaOptions: { 'facetFilters': ["language:en"], 'hitsPerPage': 6, 'distinct': 1},
debug: false // Set debug to true if you want to inspect the dropdown
});
}
diff --git a/_includes/getting-started.md b/_includes/getting-started.md
deleted file mode 100644
index 83c1de45fe..0000000000
--- a/_includes/getting-started.md
+++ /dev/null
@@ -1,193 +0,0 @@
-The instructions below cover both Scala 2 and Scala 3.
-
-## Try Scala without installing anything
-
-To start experimenting with Scala right away, use “Scastie” in your browser.
-_Scastie_ is an online “playground” where you can experiment with Scala examples to see how things work, with access to all Scala compilers and published libraries.
-
-> Scastie supports both Scala 2 and Scala 3, but it defaults
-> to Scala 3. If you are looking for a Scala 2 snippet to play with,
-> [click here](https://scastie.scala-lang.org/MHc7C9iiTbGfeSAvg8CKAA).
-
-## Install Scala on your computer
-
-Installing Scala means installing various command-line tools such as the Scala compiler and build tools.
-We recommend using the Scala installer tool "Coursier" that automatically installs all the requirements, but you can still manually install each tool.
-
-### Using the Scala Installer (recommended way)
-
-The Scala installer is a tool named [Coursier](https://get-coursier.io/docs/cli-overview), whose main command is named `cs`.
-It ensures that a JVM and standard Scala tools are installed on your system.
-Install it on your system with the following instructions.
-
-
-
-
-Along with managing JVMs, `cs setup` also installs useful command-line tools:
-
-- A JDK (if you don't have one already)
-- The [sbt](https://www.scala-sbt.org/) build tool
-- [Ammonite](https://ammonite.io/), an enhanced REPL
-- [scalafmt](https://scalameta.org/scalafmt/), the Scala code formatter
-- `scalac` (the Scala compiler)
-- `scala` (the Scala REPL and script runner).
-
-For more information about `cs`, read
-[coursier-cli documentation](https://get-coursier.io/docs/cli-overview).
-
-> `cs setup` installs the Scala 3 compiler and runner by default (the `scalac` and
-> `scala` commands, respectively). Whether you intend to use Scala 2 or 3,
-> this is usually not an issue because most projects use a build tool that will
-> use the correct version of Scala irrespective of the one installed "globally".
-> Nevertheless, you can always launch a specific version of Scala using
-> ```
-> $ cs launch scala:{{ site.scala-version }}
-> $ cs launch scalac:{{ site.scala-version }}
-> ```
-> If you prefer Scala 2 to be run by default, you can force that version to be installed with:
-> ```
-> $ cs install scala:{{ site.scala-version }} scalac:{{ site.scala-version }}
-> ```
-
-### ...or manually
-
-You only need two tools to compile, run, test, and package a Scala project: Java 8 or 11,
-and sbt.
-To install them manually:
-
-1. if you don't have Java 8 or 11 installed, download
- Java from [Oracle Java 8](https://www.oracle.com/java/technologies/javase-jdk8-downloads.html), [Oracle Java 11](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html),
- or [AdoptOpenJDK 8/11](https://adoptopenjdk.net/). Refer to [JDK Compatibility](/overviews/jdk-compatibility/overview.html) for Scala/Java compatibility detail.
-1. Install [sbt](https://www.scala-sbt.org/download.html)
-
-## Create a "Hello World" project with sbt
-
-Once you have installed sbt, you are ready to create a Scala project, which
-is explained in the following sections.
-
-To create a project, you can either use the command line or an IDE.
-If you are familiar with the command line, we recommend that approach.
-
-### Using the command line
-
-sbt is a build tool for Scala. sbt compiles, runs,
-and tests your Scala code. (It can also publish libraries and do many other tasks.)
-
-To create a new Scala project with sbt:
-
-1. `cd` to an empty folder.
-1. Run the command `sbt new scala/scala3.g8` to create a Scala 3 project, or `sbt new scala/hello-world.g8` to create a Scala 2 project.
- This pulls a project template from GitHub.
- It will also create a `target` folder, which you can ignore.
-1. When prompted, name the application `hello-world`. This will
- create a project called "hello-world".
-1. Let's take a look at what just got generated:
-
-```
-- hello-world
- - project (sbt uses this for its own files)
- - build.properties
- - build.sbt (sbt's build definition file)
- - src
- - main
- - scala (all of your Scala code goes here)
- - Main.scala (Entry point of program) <-- this is all we need for now
-```
-
-More documentation about sbt can be found in the [Scala Book](/scala3/book/tools-sbt.html) (see [here](/overviews/scala-book/scala-build-tool-sbt.html) for the Scala 2 version)
-and in the official sbt [documentation](https://www.scala-sbt.org/1.x/docs/index.html)
-
-### With an IDE
-
-You can skip the rest of this page and go directly to [Building a Scala Project with IntelliJ and sbt](/getting-started/intellij-track/building-a-scala-project-with-intellij-and-sbt.html)
-
-
-## Open hello-world project
-
-Let's use an IDE to open the project. The most popular ones are IntelliJ and VSCode.
-They both offer rich IDE features, but you can still use [many other editors.](https://scalameta.org/metals/docs/editors/overview.html)
-
-### Using IntelliJ
-
-1. Download and install [IntelliJ Community Edition](https://www.jetbrains.com/idea/download/)
-1. Install the Scala plugin by following [the instructions on how to install IntelliJ plugins](https://www.jetbrains.com/help/idea/managing-plugins.html)
-1. Open the `build.sbt` file then choose *Open as a project*
-
-### Using VSCode with metals
-
-1. Download [VSCode](https://code.visualstudio.com/Download)
-1. Install the Metals extension from [the Marketplace](https://marketplace.visualstudio.com/items?itemName=scalameta.metals)
-1. Next, open the directory containing a `build.sbt` file (this should be the directory `hello-world` if you followed the previous instructions). When prompted to do so, select *Import build*.
-
->[Metals](https://scalameta.org/metals) is a “Scala language server” that provides support for writing Scala code in VS Code and other editors like [Atom, Sublime Text, and more](https://scalameta.org/metals/docs/editors/overview.html), using the Language Server Protocol.
->
-> Under the hood, Metals communicates with the build tool by using
-> the [Build Server Protocol (BSP)](https://build-server-protocol.github.io/). For details on how Metals works, see, [“Write Scala in VS Code, Vim, Emacs, Atom and Sublime Text with Metals”](https://www.scala-lang.org/2019/04/16/metals.html).
-
-### Play with the source code
-
-View these two files in your IDE:
-
-- _build.sbt_
-- _src/main/scala/Main.scala_
-
-When you run your project in the next step, the configuration in _build.sbt_ will be used to run the code in _src/main/scala/Main.scala_.
-
-## Run Hello World
-
-If you’re comfortable using your IDE, you can run the code in _Main.scala_ from your IDE.
-
-Otherwise, you can run the application from a terminal with these steps:
-
-1. `cd` into `hello-world`.
-1. Run `sbt`. This opens up the sbt console.
-1. Type `~run`. The `~` is optional and causes sbt to re-run on every file save,
- allowing for a fast edit/run/debug cycle. sbt will also generate a `target` directory
- which you can ignore.
-
-When you’re finished experimenting with this project, press `[Enter]` to interrupt the `run` command.
-Then type `exit` or press `[Ctrl+D]` to exit sbt and return to your command line prompt.
-
-## Next Steps
-
-Once you've finished the above tutorials, consider checking out:
-
-* [The Scala Book](/scala3/book/introduction.html) (see the Scala 2 version [here](/overviews/scala-book/introduction.html)), which provides a set of short lessons introducing Scala’s main features.
-* [The Tour of Scala](/tour/tour-of-scala.html) for bite-sized introductions to Scala's features.
-* [Learning Resources](/learn.html), which includes online interactive tutorials and courses.
-* [Our list of some popular Scala books](/books.html).
-* [The migration guide](/scala3/guides/migration/compatibility-intro.html) helps you to migrate your existing Scala 2 code base to Scala 3.
-
-## Getting Help
-There are a multitude of mailing lists and real-time chat rooms in case you want to quickly connect with other Scala users. Check out our [community](https://scala-lang.org/community/) page for a list of these resources, and for where to reach out for help.
-
-
-