diff --git a/Gemfile.lock b/Gemfile.lock index 16a5f475b7..8088be3873 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -264,11 +264,11 @@ GEM minitest (5.25.4) net-http (0.6.0) uri - nokogiri (1.18.4-arm64-darwin) + nokogiri (1.18.8-arm64-darwin) racc (~> 1.4) - nokogiri (1.18.4-x64-mingw-ucrt) + nokogiri (1.18.8-x64-mingw-ucrt) racc (~> 1.4) - nokogiri (1.18.4-x86_64-linux-gnu) + nokogiri (1.18.8-x86_64-linux-gnu) racc (~> 1.4) octokit (4.25.1) faraday (>= 1, < 3) diff --git a/_config.yml b/_config.yml index a1fbe441ec..e1ed8d682e 100644 --- a/_config.yml +++ b/_config.yml @@ -17,7 +17,7 @@ keywords: scala-version: 2.13.16 scala-212-version: 2.12.20 -scala-3-version: 3.6.4 +scala-3-version: 3.7.1 collections: style: diff --git a/_data/compiler-options.yml b/_data/compiler-options.yml index a034586c42..f4cced5028 100644 --- a/_data/compiler-options.yml +++ b/_data/compiler-options.yml @@ -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" @@ -1135,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/_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/_ja/tour/higher-order-functions.md b/_ja/tour/higher-order-functions.md index 773ca7170b..95c069dc4f 100644 --- a/_ja/tour/higher-order-functions.md +++ b/_ja/tour/higher-order-functions.md @@ -40,7 +40,7 @@ Scalaコンパイラはパラメーターの型を(Intが1つだけと)既 唯一の注意点はパラメータ名の代わりに`_`を使う必要があるということです(先の例では`x`でした)。 ## メソッドを関数に強制変換 -高階関数には引数としてとしてメソッドを渡すことも可能で、それはScalaコンパイラがメソッドを関数に強制変換するからです。 +高階関数には引数としてメソッドを渡すことも可能で、それはScalaコンパイラがメソッドを関数に強制変換するからです。 ```scala mdoc case class WeeklyWeatherForecast(temperatures: Seq[Double]) { diff --git a/_overviews/jdk-compatibility/overview.md b/_overviews/jdk-compatibility/overview.md index 7ef1d62fbb..c42ee96090 100644 --- a/_overviews/jdk-compatibility/overview.md +++ b/_overviews/jdk-compatibility/overview.md @@ -14,7 +14,8 @@ Minimum Scala versions: | JDK | 3 | 3 LTS | 2.13 | 2.12 | 2.11 | |:-----------:|:--------:|:--------:|:---------:|:---------:|:----------:| -| 24 (ea) | 3.6.4 | 3.3.6* | 2.13.16 | 2.12.21* | | +| 25 (ea) | 3.7.1 | 3.3.6 | 2.13.17* | 2.12.21* | | +| 24 | 3.6.4 | 3.3.6 | 2.13.16 | 2.12.21* | | | 23 | 3.6.2 | 3.3.5 | 2.13.15 | 2.12.20 | | | 22 | 3.4.0 | 3.3.4 | 2.13.13 | 2.12.19 | | | 21 (LTS) | 3.4.0 | 3.3.1 | 2.13.11 | 2.12.18 | | diff --git a/_overviews/scala3-macros/tutorial/quotes.md b/_overviews/scala3-macros/tutorial/quotes.md index 30b6aa9295..b94d4bb6ab 100644 --- a/_overviews/scala3-macros/tutorial/quotes.md +++ b/_overviews/scala3-macros/tutorial/quotes.md @@ -433,7 +433,7 @@ As with expression quote patterns, type variables are represented using lower ca ## FromExpr -The `Expr.value`, `Expr.valueOrAbort`, and `Expr.unapply` methods uses intances of `FromExpr` to extract the value if possible. +The `Expr.value`, `Expr.valueOrAbort`, and `Expr.unapply` methods use instances of `FromExpr` to extract the value if possible. ```scala extension [T](expr: Expr[T]): def value(using Quotes)(using fromExpr: FromExpr[T]): Option[T] = diff --git a/_overviews/scala3-scaladoc/settings.md b/_overviews/scala3-scaladoc/settings.md index 3b58df7bae..1fae4d3d5f 100644 --- a/_overviews/scala3-scaladoc/settings.md +++ b/_overviews/scala3-scaladoc/settings.md @@ -182,7 +182,7 @@ Define the additional sbt configuration for your Scastie snippets. For example, ##### -dynamic-side-menu -Generate the side menu (the tree-like overview of the project structure on the left-hand side) dynamically in the browser using JavaScript instead of embedding it in every HTML file. This can greatly reduce outputted HTML file sizes. Recommended for projects with 1000+ pages. For more info see [issue 18543](https://github.com/lampepfl/dotty/issues/18543). +Generate the side menu (the tree-like overview of the project structure on the left-hand side) dynamically in the browser using JavaScript instead of embedding it in every HTML file. This can greatly reduce outputted HTML file sizes. Recommended for projects with 1000+ pages. For more info see [issue 18543](https://github.com/scala/scala3/issues/18543). ##### -Ysnippet-compiler-debug diff --git a/_overviews/toolkit/http-client-intro.md b/_overviews/toolkit/http-client-intro.md index fd2e132c54..7e8405f637 100644 --- a/_overviews/toolkit/http-client-intro.md +++ b/_overviews/toolkit/http-client-intro.md @@ -3,6 +3,7 @@ title: Sending HTTP requests with sttp type: chapter description: The introduction of the sttp library num: 23 +languages: [ru] previous-page: json-what-else next-page: http-client-request --- diff --git a/_overviews/toolkit/introduction.md b/_overviews/toolkit/introduction.md index 9bc97cb2d1..4e042e3575 100644 --- a/_overviews/toolkit/introduction.md +++ b/_overviews/toolkit/introduction.md @@ -3,6 +3,7 @@ title: Introduction type: chapter description: Introducing the Scala Toolkit tutorials num: 1 +languages: [ru] previous-page: next-page: testing-intro toolkit-index: diff --git a/_overviews/toolkit/json-intro.md b/_overviews/toolkit/json-intro.md index 7fb3e890de..9c5c789b49 100644 --- a/_overviews/toolkit/json-intro.md +++ b/_overviews/toolkit/json-intro.md @@ -3,6 +3,7 @@ title: Handling JSON with uPickle type: chapter description: Description of the uPickle library. num: 16 +languages: [ru] previous-page: os-what-else next-page: json-parse --- diff --git a/_overviews/toolkit/os-intro.md b/_overviews/toolkit/os-intro.md index 71d30f0c49..d72387f045 100644 --- a/_overviews/toolkit/os-intro.md +++ b/_overviews/toolkit/os-intro.md @@ -3,6 +3,7 @@ title: Working with files and processes with OS-Lib type: chapter description: The introduction of the OS-lib library num: 10 +languages: [ru] previous-page: testing-what-else next-page: os-read-directory --- diff --git a/_overviews/toolkit/testing-intro.md b/_overviews/toolkit/testing-intro.md index 8aa5021b76..4397be63b3 100644 --- a/_overviews/toolkit/testing-intro.md +++ b/_overviews/toolkit/testing-intro.md @@ -3,6 +3,7 @@ title: Testing with MUnit type: chapter description: The introduction of the MUnit library num: 2 +languages: [ru] previous-page: introduction next-page: testing-suite --- diff --git a/_overviews/toolkit/web-server-intro.md b/_overviews/toolkit/web-server-intro.md index 4a1efcdc6a..bf2db8a537 100644 --- a/_overviews/toolkit/web-server-intro.md +++ b/_overviews/toolkit/web-server-intro.md @@ -3,6 +3,7 @@ title: Building web servers with Cask type: chapter description: The introduction of the Cask library num: 30 +languages: [ru] previous-page: http-client-what-else next-page: web-server-static --- diff --git a/_ru/toolkit/OrderedListOfMdFiles b/_ru/toolkit/OrderedListOfMdFiles new file mode 100644 index 0000000000..b2790bd58a --- /dev/null +++ b/_ru/toolkit/OrderedListOfMdFiles @@ -0,0 +1,36 @@ +introduction.md +testing-intro.md +testing-suite.md +testing-run.md +testing-run-only.md +testing-exceptions.md +testing-asynchronous.md +testing-resources.md +testing-what-else.md +os-intro.md +os-read-directory.md +os-read-file.md +os-write-file.md +os-run-process.md +os-what-else.md +json-intro.md +json-parse.md +json-modify.md +json-deserialize.md +json-serialize.md +json-files.md +json-what-else.md +http-client-intro.md +http-client-request.md +http-client-uris.md +http-client-request-body.md +http-client-json.md +http-client-upload-file.md +http-client-what-else.md +web-server-intro.md +web-server-static.md +web-server-dynamic.md +web-server-query-parameters.md +web-server-input.md +web-server-websockets.md +web-server-cookies-and-decorators.md diff --git a/_ru/toolkit/http-client-intro.md b/_ru/toolkit/http-client-intro.md new file mode 100644 index 0000000000..6e552acecd --- /dev/null +++ b/_ru/toolkit/http-client-intro.md @@ -0,0 +1,24 @@ +--- +layout: multipage-overview +partof: toolkit +overview-name: "Scala инструментарий" +title: Отправка HTTP-запросов с помощью sttp +type: chapter +description: Введение в библиотеку sttp +language: ru +num: 23 +previous-page: +next-page: +--- + +sttp — популярная и многофункциональная библиотека для выполнения HTTP-запросов к веб-серверам. + +Она предоставляет как синхронный API, так и асинхронный API, основанный на `Future`. Она также поддерживает WebSockets. + +Доступны расширения, добавляющие такие возможности, как потоковая передача, логирование, телеметрия и сериализация. + +sttp предлагает одинаковые API на всех платформах (JVM, Scala.js и Scala Native). + +sttp — хороший выбор для небольших синхронных скриптов, а также для крупномасштабных, высококонкурентных, асинхронных приложений. + +{% include markdown.html path="_markdown/_ru/install-sttp.md" %} diff --git a/_ru/toolkit/introduction.md b/_ru/toolkit/introduction.md new file mode 100644 index 0000000000..f6a216e298 --- /dev/null +++ b/_ru/toolkit/introduction.md @@ -0,0 +1,88 @@ +--- +layout: multipage-overview +partof: toolkit +overview-name: "Scala инструментарий" +title: Введение +type: chapter +description: Знакомство с учебными пособиями по Scala инструментариям +language: ru +num: 1 +previous-page: +next-page: testing-intro +toolkit-index: + - title: Тесты + description: Тестирование кода с помощью MUnit. + icon: "fa fa-vial-circle-check" + link: /ru/toolkit/testing-intro.html + - title: Файлы и процессы + description: Запись файлов и запуск процессов с помощью OS-Lib. + icon: "fa fa-folder-open" + link: /ru/toolkit/os-intro.html + - title: JSON + description: Парсинг JSON и сериализация объектов в JSON с помощью uPickle. + icon: "fa fa-file-code" + link: /ru/toolkit/json-intro.html + - title: HTTP-запросы + description: Отправка HTTP-запросов и загрузка файлов с помощью sttp. + icon: "fa fa-globe" + link: /ru/toolkit/http-client-intro.html + - title: Веб-серверы + description: Создание веб-серверов с помощью Cask. + icon: "fa fa-server" + link: /ru/toolkit/web-server-intro.html +--- + +## Что такое набор инструментов Scala? + +Scala Toolkit — это набор библиотек, предназначенных для эффективного выполнения типичных задач программирования. +Он включает в себя инструменты для работы с файлами и процессами, парсинга JSON, отправки HTTP-запросов и модульного тестирования. + +Инструментарий поддерживает: + +- Scala 3 и Scala 2 +- JVM, Scala.js и Scala Native + +Варианты использования набора инструментов включают в себя: + +- кратковременные программы, работающие на JVM, для сканирования веб-сайта, сбора и преобразования данных + или для извлечения и обработки некоторых файлов, +- скрипты интерфейса, которые запускаются в браузере и обеспечивают работу ваших веб-сайтов, +- инструменты командной строки, упакованные в виде собственных двоичных файлов для мгновенного запуска + +{% include inner-documentation-sections.html links=page.toolkit-index %} + +## Что это за руководства? + +В этой серии руководств основное внимание уделяется кратким примерам кода, которые помогут вам быстро приступить к работе. + +Если вам нужна более подробная информация, в руководствах содержатся ссылки на дополнительную документацию +по всем библиотекам в наборе инструментов. + +## Как запустить код? + +Вы можете следовать руководствам независимо от того, как решите запустить свой Scala код. +Руководства фокусируются на самом коде, а не на процессе его запуска. + +Способы запуска кода на Scala включают: + +- В вашем **браузере** с помощью [Scastie](https://scastie.scala-lang.org) + - Плюсы: не требует установки, возможность делиться кодом онлайн + - Минусы: только один файл, доступно только онлайн +- Интерактивно в **REPL** Scala (Read/Eval/Print/Loop) + - Плюсы: интерактивное исследование в терминале + - Минусы: не сохраняет ваш код +- Интерактивно в **worksheet** в вашей IDE, например [IntelliJ](https://www.jetbrains.com/help/idea/discover-intellij-idea-for-scala.html) или [Metals](http://scalameta.org/metals/) + - Плюсы: интерактивное исследование в графическом интерфейсе + - Минусы: требует для запуска среды worksheet +- В **скриптах** с использованием [Scala CLI](https://scala-cli.virtuslab.com) + - Плюсы: рабочий процесс в терминале с минимальной настройкой + - Минусы: может не подходить для крупных проектов +- С использованием **инструмента сборки** (например, [sbt](https://www.scala-sbt.org) или [mill](https://com-lihaoyi.github.io/mill/)) + - Плюсы: рабочий процесс в терминале для проектов любого размера + - Минусы: требует дополнительной настройки и обучения +- С использованием **IDE**, например [IntelliJ](https://www.jetbrains.com/help/idea/discover-intellij-idea-for-scala.html) или [Metals](http://scalameta.org/metals/) + - Плюсы: рабочий процесс в графическом интерфейсе для проектов любого размера + - Минусы: требует дополнительной настройки и обучения + +Эти варианты, с их плюсами и минусами, характерны для большинства языков программирования. +Вы можете использовать любой из них, в зависимости от того варианта, который вам удобен. diff --git a/_ru/toolkit/json-intro.md b/_ru/toolkit/json-intro.md new file mode 100644 index 0000000000..c91f04b075 --- /dev/null +++ b/_ru/toolkit/json-intro.md @@ -0,0 +1,23 @@ +--- +layout: multipage-overview +partof: toolkit +overview-name: "Scala инструментарий" +title: Обработка JSON с помощью uPickle +type: chapter +description: Описание библиотеки uPickle. +language: ru +num: 16 +previous-page: +next-page: +--- + +uPickle — это облегченная библиотека сериализации для Scala. + +В его состав входит uJson — библиотека для работы с JSON, которая может анализировать строки JSON, +получать доступ к их значениям в памяти или изменять их, а также записывать их обратно. + +uPickle может сериализовать и десериализовать объекты Scala напрямую в JSON и из него. +Он знает, как обрабатывать коллекции Scala, такие как `Map` и `Seq`, +а также ваши собственные типы данных, такие как case class-ы и перечисления Scala 3. + +{% include markdown.html path="_markdown/_ru/install-upickle.md" %} diff --git a/_ru/toolkit/os-intro.md b/_ru/toolkit/os-intro.md new file mode 100644 index 0000000000..4e5cb4fd2a --- /dev/null +++ b/_ru/toolkit/os-intro.md @@ -0,0 +1,25 @@ +--- +layout: multipage-overview +partof: toolkit +overview-name: "Scala инструментарий" +title: Работа с файлами и процессами с помощью OS-Lib +type: chapter +description: Введение в библиотеку OS-lib +language: ru +num: 10 +previous-page: +next-page: +--- + +OS-Lib — это библиотека для работы с файлами и процессами. Она является частью Scala Toolkit. + +OS-Lib стремится заменить API `java.nio.file` и `java.lang.ProcessBuilder`. +Скорее всего, вам не понадобиться напрямую использовать какие-либо низкоуровневые Java API. + +OS-Lib также нацелена на то, чтобы вытеснить устаревшие API `scala.io` и `scala.sys` из стандартной библиотеки Scala. + +OS-Lib не имеет зависимостей. + +Весь функционал OS-Lib находится в пространстве имён `os.*`. + +{% include markdown.html path="_markdown/_ru/install-os-lib.md" %} diff --git a/_ru/toolkit/testing-intro.md b/_ru/toolkit/testing-intro.md new file mode 100644 index 0000000000..3fa905ddb3 --- /dev/null +++ b/_ru/toolkit/testing-intro.md @@ -0,0 +1,28 @@ +--- +layout: multipage-overview +partof: toolkit +overview-name: "Scala инструментарий" +title: Тестирование с помощью MUnit +type: chapter +description: Введение в библиотеку MUnit +language: ru +num: 2 +previous-page: introduction +next-page: +--- + +MUnit — легковесная библиотека для тестирования. Она предоставляет единый стиль написания тестов, который можно быстро освоить. + +Несмотря на свою простоту, MUnit обладает такими полезными функциями, как: + +- **утверждения (assertions)** для проверки поведения программы, +- **фикстуры (fixtures)**, чтобы гарантировать, что тесты имеют доступ ко всем необходимым ресурсам, +- **поддержка асинхронности** для тестирования параллельных (concurrent) и распределённых приложений. + +MUnit создаёт полезные отчёты об ошибках с указанием различий и местоположения в исходном коде, что помогает быстро понять причины сбоев. + +Тестирование является важной частью любого процесса разработки программного обеспечения, +так как оно помогает находить ошибки на ранних этапах, +улучшает качество кода и облегчает совместную работу. + +{% include markdown.html path="_markdown/_ru/install-munit.md" %} diff --git a/_ru/toolkit/web-server-intro.md b/_ru/toolkit/web-server-intro.md new file mode 100644 index 0000000000..6afdebab4f --- /dev/null +++ b/_ru/toolkit/web-server-intro.md @@ -0,0 +1,30 @@ +--- +layout: multipage-overview +partof: toolkit +overview-name: "Scala инструментарий" +title: Создание веб-серверов с помощью Cask +type: chapter +description: Введение в библиотеку Cask +language: ru +num: 30 +previous-page: +next-page: +--- + +Cask — это микрофреймворк HTTP, предоставляющий простой и гибкий способ создания веб-приложений. + +Основное внимание уделяется простоте использования, что делает его идеальным для новичков, +но при этом приходится отказываться от некоторых функций, предоставляемых другими фреймворками, например, асинхронности. + +Чтобы определить endpoint, достаточно аннотировать функцию аннотацией, указывающей путь запроса. +Cask позволяет вручную строить ответ с помощью инструментов, предоставляемых библиотекой, +указывая содержимое, заголовки, код статуса и т.д. +Функция endpoint также может возвращать строку, JSON тип [uPickle](https://com-lihaoyi.github.io/upickle/) +или шаблон [Scalatags](https://com-lihaoyi.github.io/scalatags/). +В этом случае Cask автоматически создаст ответ с соответствующими заголовками. + +Cask поставляется в комплекте с библиотекой uPickle для обработки JSON, поддерживает WebSockets +и позволяет расширять конечные точки с помощью декораторов, +которые можно использовать для обработки аутентификации или ограничения скорости. + +{% include markdown.html path="_markdown/_ru/install-cask.md" %} diff --git a/_ru/tour/abstract-type-members.md b/_ru/tour/abstract-type-members.md index a56239034c..537ebf80f4 100644 --- a/_ru/tour/abstract-type-members.md +++ b/_ru/tour/abstract-type-members.md @@ -10,7 +10,7 @@ topics: abstract type members prerequisite-knowledge: variance, upper-type-bound --- -Абстрактные типы, такие как трейты и абстрактные классы, могут содержать членов абстрактного типа. +Абстрактные типы, такие как трейты и абстрактные классы, могут содержать члены абстрактного типа. Абстрактный означает, что только конкретный экземпляр определяет, каким именно будет тип. Вот пример: @@ -36,7 +36,7 @@ trait Buffer: {% endtab %} {% endtabs %} -Здесь мы определили абстрактный тип `T`, который используется для описания типа члена `element`. Мы можем расширить его в абстрактном классе, добавив верхнюю границу нового типа `U` связанного с `T`, делая описание типа более конкретным. +Здесь мы определили абстрактный тип `T`, который используется для описания типа члена `element`. Мы можем расширить его в абстрактном классе, добавив верхнюю границу нового типа `U`, связанного с `T`, делая описание типа более конкретным. {% tabs abstract-types_2 class=tabs-scala-version %} {% tab 'Scala 2' for=abstract-types_2 %} @@ -64,7 +64,7 @@ abstract class SeqBuffer extends Buffer: Обратите внимание, как мы можем использовать новый абстрактный тип `U` в качестве верхней границы типа. Класс `SeqBuffer` позволяет хранить в буфере только последовательности, указывая, что тип `T` должен быть подтипом `Seq[U]` для нового абстрактного типа `U`. -[Трейты](traits.html) или [классы](classes.html) с членами абстрактного типа часто используются в сочетании с анонимными экземплярами классов. Чтобы проиллюстрировать это рассмотрим программу, которая имеет дело с буфером, который ссылается на список целых чисел: +[Трейты](traits.html) или [классы](classes.html) с членами абстрактного типа часто используются в сочетании с анонимными экземплярами классов. Чтобы проиллюстрировать это рассмотрим программу, имеющую дело с буфером, который ссылается на список целых чисел: {% tabs abstract-types_3 class=tabs-scala-version %} {% tab 'Scala 2' for=abstract-types_3 %} @@ -104,9 +104,9 @@ println("content = " + buf.element) {% endtab %} {% endtabs %} -Здесь класс `newIntSeqBuf` создает экземпляры `IntSeqBuffer`, используя анонимную реализацию класса `IntSeqBuffer` (т.е. `new IntSeqBuffer`), устанавливая тип `T` как `List[Int]`. +Здесь метод `newIntSeqBuf` создает экземпляры `IntSeqBuffer`, используя анонимную реализацию класса `IntSeqBuffer` (т.е. `new IntSeqBuffer`), устанавливая тип `T` как `List[Int]`. -Мы можем вывести тип класса из типа его членов и наоборот. Приведем версию кода, в которой выводится тип класса из типа его члена: +Мы можем вывести тип класса из типа его членов и наоборот. Приведем версию кода, в которой выводится тип класса из типов его члена: {% tabs abstract-types_4 class=tabs-scala-version %} {% tab 'Scala 2' for=abstract-types_4 %} diff --git a/_sips/sips/alternative-bind-variables.md b/_sips/sips/alternative-bind-variables.md index 55e243dbd6..ab6899a026 100644 --- a/_sips/sips/alternative-bind-variables.md +++ b/_sips/sips/alternative-bind-variables.md @@ -317,7 +317,7 @@ The associated [thread](https://contributors.scala-lang.org/t/pre-sip-bind-varia ## Implementation The author has a current in-progress implementation focused on the typer which compiles the examples with the expected types. Interested - parties are welcome to see the WIP [here](https://github.com/lampepfl/dotty/compare/main...yilinwei:dotty:main). + parties are welcome to see the WIP [here](https://github.com/scala/scala3/compare/main...yilinwei:dotty:main). ### Further work diff --git a/_sips/sips/better-fors.md b/_sips/sips/better-fors.md index 54ba1b8e31..10cfa733ea 100644 --- a/_sips/sips/better-fors.md +++ b/_sips/sips/better-fors.md @@ -472,9 +472,9 @@ The only Open community build library that failed because of the change to the d ## Links 1. Scala contributors discussion thread (pre-SIP): https://contributors.scala-lang.org/t/pre-sip-improve-for-comprehensions-functionality/3509/51 -2. Github issue discussion about for desugaring: https://github.com/lampepfl/dotty/issues/2573 +2. Github issue discussion about for desugaring: https://github.com/scala/scala3/issues/2573 3. Scala 2 implementation of some of the improvements: https://github.com/oleg-py/better-monadic-for -4. Implementation of one of the simplifications: https://github.com/lampepfl/dotty/pull/16703 +4. Implementation of one of the simplifications: https://github.com/scala/scala3/pull/16703 5. Draft implementation branch: https://github.com/dotty-staging/dotty/tree/improved-fors 6. Minimized issue reproducing the problem with the current desugaring: https://github.com/scala/scala3/issues/21804 7. (empty :sad:) Contributors thread about better effect loops with for-comprehensions: https://contributors.scala-lang.org/t/pre-sip-sip-62-addition-proposal-better-effect-loops-with-for-comprehensions/6759 diff --git a/_sips/sips/binary-api.md b/_sips/sips/binary-api.md index 2e532ffc3f..e94bf85a54 100644 --- a/_sips/sips/binary-api.md +++ b/_sips/sips/binary-api.md @@ -33,7 +33,7 @@ Currently, the compiler automatically generates accessors for references to priv * Changing the implementation of an inline definition can be a binary incompatible change * Removing final from a class is a binary incompatible change -You can find more details in [https://github.com/lampepfl/dotty/issues/16983](https://github.com/lampepfl/dotty/issues/16983) +You can find more details in [https://github.com/scala/scala3/issues/16983](https://github.com/scala/scala3/issues/16983) ### Avoid duplication of inline accessors @@ -249,7 +249,7 @@ Using references to `@publicInBinary` in inline code can cause binary incompatib ### Add a `@binaryAccessor` This annotation would generate an stable accessor. This annotation could be used on `private` definition. It would also mitigate [migration costs](https://gist.github.com/nicolasstucki/003f7293941836b08a0d53dbcb913e3c) for library authors that have published unstable accessors. -* Implementation https://github.com/lampepfl/dotty/pull/16992 +* Implementation https://github.com/scala/scala3/pull/16992 ### Make all `private[C]` part of the binary API @@ -268,9 +268,9 @@ The drawback of this approach is that that we would need to force users to keep ## Related work -* Initial discussions: [https://github.com/lampepfl/dotty/issues/16983](https://github.com/lampepfl/dotty/issues/16983) -* Initial proof of concept (outdated): [https://github.com/lampepfl/dotty/pull/16992](https://github.com/lampepfl/dotty/pull/16992) -* Single annotation proof of concept: [https://github.com/lampepfl/dotty/pull/18402](https://github.com/lampepfl/dotty/pull/18402) +* Initial discussions: [https://github.com/scala/scala3/issues/16983](https://github.com/scala/scala3/issues/16983) +* Initial proof of concept (outdated): [https://github.com/scala/scala3/pull/16992](https://github.com/scala/scala3/pull/16992) +* Single annotation proof of concept: [https://github.com/scala/scala3/pull/18402](https://github.com/scala/scala3/pull/18402) * Community migration analysis: [Gist](https://gist.github.com/nicolasstucki/003f7293941836b08a0d53dbcb913e3c) * Kotlin: [PublishedApi](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-published-api/) plays the same role as `@publicInBinary` but its interaction with (inline definitions)[https://kotlinlang.org/docs/inline-functions.html#restrictions-for-public-api-inline-functions] diff --git a/_sips/sips/byname-implicits.md b/_sips/sips/byname-implicits.md index 24b701ee20..fd63269068 100644 --- a/_sips/sips/byname-implicits.md +++ b/_sips/sips/byname-implicits.md @@ -39,7 +39,7 @@ the knot" implicitly. ### Implementation status -Byname implicits have been implemented in [Dotty](https://github.com/lampepfl/dotty/issues/1998) +Byname implicits have been implemented in [Dotty](https://github.com/scala/scala3/issues/1998) with an earlier iteration of the divergence checking algorithm described below. A full implementation of this proposal exists as a [pull request](https://github.com/scala/scala/pull/6050) relative to the 2.13.x branch of the Lightbend Scala compiler and it is scheduled to be included in @@ -851,7 +851,7 @@ object Test { because the path `foo` in `foo.Out` is not stable. Full parity with shapeless's `Lazy` would require lazy (rather than byname) implicit parameters (see [this Dotty -ticket](https://github.com/lampepfl/dotty/issues/3005) for further discussion) and is orthogonal to +ticket](https://github.com/scala/scala3/issues/3005) for further discussion) and is orthogonal to this SIP in that they would drop out of support for lazy parameters more generally, as described in [this Scala ticket](https://github.com/scala/bug/issues/240). diff --git a/_sips/sips/clause-interleaving.md b/_sips/sips/clause-interleaving.md index 5e24c4f700..e9809815e2 100644 --- a/_sips/sips/clause-interleaving.md +++ b/_sips/sips/clause-interleaving.md @@ -167,7 +167,7 @@ As discussed above, we may want to consider generalizing class parameter lists a ## Related work * Pre-SIP: [https://contributors.scala-lang.org/t/clause-interweaving-allowing-def-f-t-x-t-u-y-u/5525](https://contributors.scala-lang.org/t/clause-interweaving-allowing-def-f-t-x-t-u-y-u/5525) -* An implementation of the proposal is available as a pull request at [https://github.com/lampepfl/dotty/pull/14019](https://github.com/lampepfl/dotty/pull/14019) +* An implementation of the proposal is available as a pull request at [https://github.com/scala/scala3/pull/14019](https://github.com/scala/scala3/pull/14019) ## FAQ Currently empty. diff --git a/_sips/sips/fewer-braces.md b/_sips/sips/fewer-braces.md index e220480796..321f665233 100644 --- a/_sips/sips/fewer-braces.md +++ b/_sips/sips/fewer-braces.md @@ -131,7 +131,7 @@ If there would be code using these idioms, it can be rewritten quite simply to a ### Tooling -Since this affects parsing, the scalameta parser and any other parser used in an IDE will also need to be updated. The necessary changes to the Scala 3 parser were made here: https://github.com/lampepfl/dotty/pull/15273/commits. The commit that embodies the core change set is here: https://github.com/lampepfl/dotty/pull/15273/commits/421bdd660b0456c2ff1ae386f032c41bb1e0212a. +Since this affects parsing, the scalameta parser and any other parser used in an IDE will also need to be updated. The necessary changes to the Scala 3 parser were made here: https://github.com/scala/scala3/pull/15273/commits. The commit that embodies the core change set is here: https://github.com/scala/scala3/pull/15273/commits/421bdd660b0456c2ff1ae386f032c41bb1e0212a. ### Handling Edge Cases @@ -288,7 +288,7 @@ This is a tradeoff between conciseness and consistency. In the interest of minim - Doc page for proposed change: https://dotty.epfl.ch/docs/reference/other-new-features/indentation.html#variant-indentation-marker--for-arguments - - Merged PR implementing the proposal under experimental flag: https://github.com/lampepfl/dotty/pull/15273/commits/421bdd660b0456c2ff1ae386f032c41bb1e0212a + - Merged PR implementing the proposal under experimental flag: https://github.com/scala/scala3/pull/15273/commits/421bdd660b0456c2ff1ae386f032c41bb1e0212a - Latest discussion on contributors (there were several before when we discussed indentation in general): https://contributors.scala-lang.org/t/make-fewerbraces-available-outside-snapshot-releases/5024/166 diff --git a/_sips/sips/interpolation-quote-escape.md b/_sips/sips/interpolation-quote-escape.md index 4602cbaa5c..6f0398ce33 100644 --- a/_sips/sips/interpolation-quote-escape.md +++ b/_sips/sips/interpolation-quote-escape.md @@ -129,4 +129,4 @@ proposals. [^4]: https://github.com/scala/bug/issues/6476#issuecomment-292412577 "@retronym said: +1 to s"$"". Because it doesn't compile today, we don't risk changing the meaning of existing programs." [^5]: https://github.com/Scala/Scala/pull/6953/files#diff-0023b3bfa053fb16603156b785efa7ad "" [^6]: https://github.com/Scala/Scala/pull/4308 "SI-6476 Accept escaped quotes in interp strings" -[^7]: https://github.com/lampepfl/dotty/pull/7486 "PR in dotty" +[^7]: https://github.com/scala/scala3/pull/7486 "PR in dotty" diff --git a/_sips/sips/match-types-spec.md b/_sips/sips/match-types-spec.md index 2025da63eb..049fad9415 100644 --- a/_sips/sips/match-types-spec.md +++ b/_sips/sips/match-types-spec.md @@ -95,7 +95,7 @@ It is however not possible to guarantee that property for *all* cases, since the #### Preamble Some of the concepts mentioned here are defined in the existing Scala 3 specification draft. -That draft can be found in the dotty repository at https://github.com/lampepfl/dotty/tree/main/docs/_spec. +That draft can be found in the dotty repository at https://github.com/scala/scala3/tree/main/docs/_spec. It is not rendered anywhere yet, though. Here are some of the relevant concepts that are perhaps lesser-known: @@ -583,7 +583,7 @@ Notable prior work related to this proposal includes: - [Current reference page for Scala 3 match types](https://dotty.epfl.ch/docs/reference/new-types/match-types.html) - [Abstractions for Type-Level Programming](https://infoscience.epfl.ch/record/294024), Olivier Blanvillain, Chapter 4 (Match Types) - ["Pre-Sip" discussion in the Contributors forum](https://contributors.scala-lang.org/t/pre-sip-proper-specification-for-match-types/6265) (submitted at the same time as this SIP document) -- [PR with the proposed implementation](https://github.com/lampepfl/dotty/pull/18262) +- [PR with the proposed implementation](https://github.com/scala/scala3/pull/18262) ## FAQ diff --git a/_sips/sips/multi-source-extension-overloads.md b/_sips/sips/multi-source-extension-overloads.md index 2fd0bd096e..fdcfd7050b 100644 --- a/_sips/sips/multi-source-extension-overloads.md +++ b/_sips/sips/multi-source-extension-overloads.md @@ -226,7 +226,7 @@ A number of alternatives were mentioned in [the Contributors thread](https://con ## Related work - [Contributors thread acting as de facto Pre-SIP](https://contributors.scala-lang.org/t/change-shadowing-mechanism-of-extension-methods-for-on-par-implicit-class-behavior/5831) -- [Pull Request in dotty](https://github.com/lampepfl/dotty/pull/17050) to support it under an experimental import +- [Pull Request in dotty](https://github.com/scala/scala3/pull/17050) to support it under an experimental import ## FAQ diff --git a/_sips/sips/named-tuples.md b/_sips/sips/named-tuples.md index 995d409031..431107cd14 100644 --- a/_sips/sips/named-tuples.md +++ b/_sips/sips/named-tuples.md @@ -382,7 +382,7 @@ This section should list prior work related to the proposal, notably: - [SIP 43 on Pattern Matching with Named Fields](https://github.com/scala/improvement-proposals/pull/44) -- [Experimental Implementation](https://github.com/lampepfl/dotty/pull/19174) +- [Experimental Implementation](https://github.com/scala/scala3/pull/19174) ## FAQ diff --git a/_sips/sips/polymorphic-eta-expansion.md b/_sips/sips/polymorphic-eta-expansion.md index 4883a5469c..4099e05cc8 100644 --- a/_sips/sips/polymorphic-eta-expansion.md +++ b/_sips/sips/polymorphic-eta-expansion.md @@ -420,7 +420,7 @@ No other alternatives have been imagined, the similarity between this proposal a - If there is already a proof-of-concept implementation, a link to it will be welcome here. --> * Pre-SIP: https://contributors.scala-lang.org/t/polymorphic-eta-expansion/5516 -* A naive implementation can be found at https://github.com/lampepfl/dotty/pull/14015 (it is more general than this proposal and thus breaks compatibility) +* A naive implementation can be found at https://github.com/scala/scala3/pull/14015 (it is more general than this proposal and thus breaks compatibility) * A compatibility-preserving implementation is in development. diff --git a/_sips/sips/priority-based-infix-type-precedence.md b/_sips/sips/priority-based-infix-type-precedence.md index 55c8af6566..a67d84dbb5 100644 --- a/_sips/sips/priority-based-infix-type-precedence.md +++ b/_sips/sips/priority-based-infix-type-precedence.md @@ -137,7 +137,7 @@ However, it is very unlikely that such interaction would occur. **Related Issues** -* [Dotty Issue #1961](https://github.com/lampepfl/dotty/issues/1961) +* [Dotty Issue #1961](https://github.com/scala/scala3/issues/1961) ## Backward Compatibility diff --git a/_sips/sips/quote-pattern-type-variable-syntax.md b/_sips/sips/quote-pattern-type-variable-syntax.md index f8a624f971..64f58fafb8 100644 --- a/_sips/sips/quote-pattern-type-variable-syntax.md +++ b/_sips/sips/quote-pattern-type-variable-syntax.md @@ -61,11 +61,11 @@ We want to be able to set the bounds of type variables to be able to match again ```scala case '[ head *: tail ] => h[tail] ``` -See [https://github.com/lampepfl/dotty/issues/11738](https://github.com/lampepfl/dotty/issues/11738). +See [https://github.com/scala/scala3/issues/11738](https://github.com/scala/scala3/issues/11738). ### Support matching on any kind of type We want to match against higher-kinded (or `AnyKind`) types. This is not possible due to the default upper bound of `Any`. -See [https://github.com/lampepfl/dotty/issues/10864](https://github.com/lampepfl/dotty/issues/10864). +See [https://github.com/scala/scala3/issues/10864](https://github.com/scala/scala3/issues/10864). ### Support multiple references to the same type in quoted type patterns We want to be able to match using several references to the same type variable. @@ -137,8 +137,8 @@ TASTy only contains explicit type variable definitions, and this encoding would ## Related work -* Proof of concept of type variable syntax: [https://github.com/lampepfl/dotty/pull/16910](https://github.com/lampepfl/dotty/pull/16910) -* Proof of concept of backticks (only interested in the first bullet point): [https://github.com/lampepfl/dotty/pull/16935](https://github.com/lampepfl/dotty/pull/16935) +* Proof of concept of type variable syntax: [https://github.com/scala/scala3/pull/16910](https://github.com/scala/scala3/pull/16910) +* Proof of concept of backticks (only interested in the first bullet point): [https://github.com/scala/scala3/pull/16935](https://github.com/scala/scala3/pull/16935) * Implementation: [https://github.com/scala/scala3/pull/17362](https://github.com/scala/scala3/pull/17362) * Stabilized implementation: [https://github.com/scala/scala3/pull/18574](https://github.com/scala/scala3/pull/18574) diff --git a/_sips/sips/trait-parameters.md b/_sips/sips/trait-parameters.md index 93bcd8bf70..633f0c0b73 100644 --- a/_sips/sips/trait-parameters.md +++ b/_sips/sips/trait-parameters.md @@ -69,4 +69,4 @@ the evaluation order would be `e1`, initializer of `T`, `e2`, initializer of `V` ## See Also ## -[Dotty Issue #640](https://github.com/lampepfl/dotty/issues/640) +[Dotty Issue #640](https://github.com/scala/scala3/issues/640) diff --git a/_zh-cn/overviews/reflection/overview.md b/_zh-cn/overviews/reflection/overview.md index fb80386e2a..25f54810e9 100644 --- a/_zh-cn/overviews/reflection/overview.md +++ b/_zh-cn/overviews/reflection/overview.md @@ -85,7 +85,7 @@ decls: Iterable[ru.Symbol] = List(constructor List, method companion, method isE #### 1.1.2 运行时实例化一个类型 -通过反射获得的类型,可以通过使用适当的“调用器”镜像调用它们的构造函数来实例化(镜像`mirros`的概念在[后续文档中说明](https://docs.scala-lang.org/overviews/reflection/overview.html#mirrors))。 +通过反射获得的类型,可以通过使用适当的“调用器”镜像调用它们的构造函数来实例化(镜像`mirrors`的概念在[后续文档中说明](https://docs.scala-lang.org/overviews/reflection/overview.html#mirrors))。 让我们通过一个REPL的示例说明: @@ -269,7 +269,7 @@ Scala反射实现了允许在编译阶段就对程序进行修改的一种元编 这个反射环境根据是在运行时环境完成反射任务还是在编译时环境完成反射任务而有所区别。 这个区别被封装于所谓的`universe`中。 反射环境的另一个重要方面就是我们可以访问想反射的那组实体, -这组实体由所谓的镜像`mirros`去确定。 +这组实体由所谓的镜像`mirrors`去确定。 镜像不仅决定反射化操作有哪些实体要被访问到,而且它还提供了反射操作去执行那些实体。 比如在运行时反射过程中可以调用镜像去操作类中一个方法或构造器。 @@ -293,4 +293,4 @@ import scala.reflect.runtime.universe._ 反射所能提供的信息都是通过镜像去访问的。 根据不同的类型信息或不同的反射操作,必须要使用不同类型的镜像。 -更多细节请参阅指南中[Mirros](https://docs.scala-lang.org/overviews/reflection/environment-universes-mirrors.html)部分,或者看`scala.reflect.api`包的[Mirrors API文档](https://www.scala-lang.org/api/2.x/scala-reflect/scala/reflect/api/Mirrors.html)。 +更多细节请参阅指南中[Mirrors](https://docs.scala-lang.org/overviews/reflection/environment-universes-mirrors.html)部分,或者看`scala.reflect.api`包的[Mirrors API文档](https://www.scala-lang.org/api/2.x/scala-reflect/scala/reflect/api/Mirrors.html)。 diff --git a/api/all.md b/api/all.md index 7543731252..6f049664b7 100644 --- a/api/all.md +++ b/api/all.md @@ -10,8 +10,8 @@ redirect_from: * Scala {{site.scala-3-version}} * [Library API](https://www.scala-lang.org/api/{{site.scala-3-version}}/) -* Scala 3.3.5 LTS - * [Library API](https://www.scala-lang.org/api/3.3.5/) +* Scala 3.3.6 LTS + * [Library API](https://www.scala-lang.org/api/3.3.6/) * Scala 2.13.16 * [Library API](https://www.scala-lang.org/api/2.13.16/) * [Compiler API](https://www.scala-lang.org/api/2.13.16/scala-compiler/scala/) @@ -64,6 +64,10 @@ https://scala-ci.typesafe.com/artifactory/scala-integration/org/scala-lang/ ## Previous releases +* Scala 3.7.0 + * [Library API](https://www.scala-lang.org/api/3.7.0/) +* Scala 3.6.4 + * [Library API](https://www.scala-lang.org/api/3.6.4/) * Scala 3.6.3 * [Library API](https://www.scala-lang.org/api/3.6.3/) * Scala 3.6.2 @@ -82,6 +86,8 @@ https://scala-ci.typesafe.com/artifactory/scala-integration/org/scala-lang/ * [Library API](https://www.scala-lang.org/api/3.4.1/) * Scala 3.4.0 * [Library API](https://www.scala-lang.org/api/3.4.0/) +* Scala 3.3.5 LTS + * [Library API](https://www.scala-lang.org/api/3.3.5/) * Scala 3.3.4 LTS * [Library API](https://www.scala-lang.org/api/3.3.4/) * Scala 3.3.3 LTS