Skip to content

Commit

Permalink
Merge branch 'main' into th_tour_traits
Browse files Browse the repository at this point in the history
  • Loading branch information
fResult authored Oct 27, 2024
2 parents d57d5dd + b8e1b21 commit e4fa32b
Show file tree
Hide file tree
Showing 137 changed files with 5,579 additions and 1,079 deletions.
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.8)
strscan (>= 3.0.9)
rexml (3.3.6)
strscan
rouge (3.30.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
Expand Down Expand Up @@ -280,7 +280,7 @@ GEM
unf_ext (0.0.9.1-x64-mingw-ucrt)
unicode-display_width (1.8.0)
uri (0.13.0)
webrick (1.8.1)
webrick (1.8.2)
yell (2.2.2)
zeitwerk (2.6.7)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Scala Documentation #

[![Build Status](https://ci.scala-lang.org/api/badges/scala/docs.scala-lang/status.svg)](https://platform-ci.scala-lang.org/scala/docs.scala-lang)
[![Build Status](https://github.com/scala/docs.scala-lang/actions/workflows/build.yml/badge.svg)](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.

Expand Down
7 changes: 0 additions & 7 deletions _ba/tour/automatic-closures.md

This file was deleted.

6 changes: 3 additions & 3 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ keywords:
- Document
- Guide

scala-version: 2.13.14
scala-212-version: 2.12.19
scala-3-version: 3.4.2
scala-version: 2.13.15
scala-212-version: 2.12.20
scala-3-version: 3.5.2

collections:
style:
Expand Down
4 changes: 0 additions & 4 deletions _data/compiler-options.yml
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,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"
Expand Down
7 changes: 6 additions & 1 deletion _data/doc-nav-header.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
- 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: Scala 3
url: "#"
submenu:
Expand Down
2 changes: 2 additions & 0 deletions _data/footer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
url: "http://scala-lang.org/community/"
- title: Governance
url: "http://scala-lang.org/community/index.html#governance"
- title: Scala Ambassadors
url: "http://scala-lang.org/ambassadors/"
- title: Mailing Lists
url: "http://scala-lang.org/community/index.html#mailing-lists"
- title: Chat Rooms & More
Expand Down
3 changes: 3 additions & 0 deletions _data/overviews.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@
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."
Expand Down
2 changes: 1 addition & 1 deletion _data/setup-scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ linux-x86-64: curl -fL https://github.com/coursier/coursier/releases/latest/down
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/formulas/coursier && 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
65 changes: 0 additions & 65 deletions _es/tour/automatic-closures.md

This file was deleted.

2 changes: 1 addition & 1 deletion _es/tour/multiple-parameter-lists.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ partof: scala-tour
num: 15
language: es

next-page: automatic-closures
next-page: operators
previous-page: nested-functions
---

Expand Down
2 changes: 1 addition & 1 deletion _es/tour/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
1 change: 0 additions & 1 deletion _es/tour/tour-of-scala.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
File renamed without changes.
7 changes: 0 additions & 7 deletions _fr/tour/automatic-closures.md

This file was deleted.

37 changes: 37 additions & 0 deletions _includes/_markdown/install-cask.md
Original file line number Diff line number Diff line change
@@ -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.9.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.9.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.3.3"
def ivyDeps = Agg(
ivy"com.lihaoyi::cask::0.9.2"
)
}
```
{% endtab %}

{% endtabs %}
{% endaltDetails %}
5 changes: 3 additions & 2 deletions _includes/_markdown/install-munit.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ Alternatively, you can require just a specific version of MUnit:
{% tab 'sbt' %}
In your build.sbt file, you can add the dependency on toolkit-test:
```scala
lazy val example = project.in(file("example"))
lazy val example = project.in(file("."))
.settings(
scalaVersion := "3.3.3",
libraryDependencies += "org.scala-lang" %% "toolkit-test" % "0.1.7" % Test
)
```
Here the `Test` configuration means that the dependency is only used by the source files in `example/src/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
Expand Down
2 changes: 1 addition & 1 deletion _includes/_markdown/install-os-lib.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Alternatively, you can require just a specific version of OS-Lib:
{% tab 'sbt' %}
In your `build.sbt`, you can add a dependency on the toolkit:
```scala
lazy val example = project.in(file("example"))
lazy val example = project.in(file("."))
.settings(
scalaVersion := "3.3.3",
libraryDependencies += "org.scala-lang" %% "toolkit" % "0.1.7"
Expand Down
2 changes: 1 addition & 1 deletion _includes/_markdown/install-sttp.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Alternatively, you can require just a specific version of sttp:
{% tab 'sbt' %}
In your build.sbt file, you can add a dependency on the Toolkit:
```scala
lazy val example = project.in(file("example"))
lazy val example = project.in(file("."))
.settings(
scalaVersion := "3.3.3",
libraryDependencies += "org.scala-lang" %% "toolkit" % "0.1.7"
Expand Down
2 changes: 1 addition & 1 deletion _includes/_markdown/install-upickle.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Alternatively, you can require just a specific version of UPickle:
{% tab 'sbt' %}
In your build.sbt file, you can add the dependency on the Toolkit:
```scala
lazy val example = project.in(file("example"))
lazy val example = project.in(file("."))
.settings(
scalaVersion := "3.3.3",
libraryDependencies += "org.scala-lang" %% "toolkit" % "0.1.7"
Expand Down
2 changes: 2 additions & 0 deletions _includes/alert-banner.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{% comment %}use the variable 'message' to include markdown text to display in the alert.{% endcomment %}

{% unless include.message_id == 'disabled' %}
<header id="site-header" class="header-home">
<div class="new-on-the-blog alert-warning" data-message_id="{{include.message_id}}">
<p>{{include.message|markdownify}}</p>
<span class="hide"><i class="fa fa-close"></i></span>
</div>
</header>
{% endunless %}
File renamed without changes.
2 changes: 1 addition & 1 deletion _ja/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sections:
- title: "入門"
description: "あなたのコンピューターに Scala をインストールして、Scala コードを書きはじめよう!"
icon: "fa fa-rocket"
link: /ja/getting-started/index.html
link: /ja/getting-started/install-scala.html
- title: "Scala ツアー"
description: "コア言語機能をひと口大で紹介"
icon: "fa fa-flag"
Expand Down
2 changes: 1 addition & 1 deletion _ja/overviews/macros/paradise.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ title: マクロパラダイス
マクロパラダイス (Macro paradise) とは Scala の複数のバージョンをサポートするコンパイラプラグインで、一般向けにリリースされている <code>scalac</code> と共に正しく動作するように設計されている。
これによって、将来の Scala に取り込まれるよりもいち早く最新のマクロ機能を使えるようになっている。
[サポートされている機能とバージョンの一覧](/ja/overviews/macros/roadmap.html))に関してはロードマップページを、
動作の保証に関しては[マクロパラダイスのアナウンスメント](https://scalamacros.org/news/2013/08/07/roadmap-for-macro-paradise.html)を参照してほしい。
動作の保証に関しては[マクロパラダイスのアナウンスメント](hxxps://scalamacros.org/news/2013/08/07/roadmap-for-macro-paradise.html)を参照してほしい。

~/210x $ scalac -Xplugin:paradise_*.jar -Xshow-phases
phase name id description
Expand Down
2 changes: 1 addition & 1 deletion _ja/overviews/macros/typemacros.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: 型マクロ
**Eugene Yokota 訳**

型マクロ (type macro) は[マクロパラダイス](/ja/overviews/macros/paradise.html)の以前のバージョンから利用可能だったが、マクロパラダイス 2.0 ではサポートされなくなった。
[the paradise 2.0 announcement](https://scalamacros.org/news/2013/08/05/macro-paradise-2.0.0-snapshot.html) に説明と移行のための戦略が書かれている。
[the paradise 2.0 announcement](hxxps://scalamacros.org/news/2013/08/05/macro-paradise-2.0.0-snapshot.html) に説明と移行のための戦略が書かれている。

## 直観

Expand Down
2 changes: 1 addition & 1 deletion _ja/overviews/macros/untypedmacros.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: 型指定の無いマクロ
**Eugene Yokota 訳**

型指定の無いマクロ (untyped macro) は[マクロパラダイス](/ja/overviews/macros/paradise.html)の以前のバージョンから利用可能だったが、マクロパラダイス 2.0 ではサポートされなくなった。
[the paradise 2.0 announcement](https://scalamacros.org/news/2013/08/05/macro-paradise-2.0.0-snapshot.html) に説明と移行のための戦略が書かれている。
[the paradise 2.0 announcement](hxxps://scalamacros.org/news/2013/08/05/macro-paradise-2.0.0-snapshot.html) に説明と移行のための戦略が書かれている。

## 直観

Expand Down
4 changes: 2 additions & 2 deletions _ja/overviews/macros/usecases.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Scala の商用ユーザと研究ユーザの両方がマクロを利用して
ここ EPFL においても我々はマクロを活用して研究を行っている。Lightbend 社もマクロを数々のプロジェクトに採用している。
マクロはコミュニティー内でも人気があり、既にいくつかの興味深い応用が現れている。

最近行われた講演の ["What Are Macros Good For?"](https://scalamacros.org/paperstalks/2014-02-04-WhatAreMacrosGoodFor.pdf) では Scala 2.10 ユーザのマクロの利用方法を説明し、システム化した。講演の大筋はマクロはコード生成、静的な検査、および DSL に有効であるということで、これを研究や産業からの例を交えながら説明した。
最近行われた講演の ["What Are Macros Good For?"](https://github.com/scalamacros/scalamacros.github.com/blob/5904f7ef88a439c668204b4bf262835e89fb13cb/paperstalks/2014-02-04-WhatAreMacrosGoodFor.pdf) では Scala 2.10 ユーザのマクロの利用方法を説明し、システム化した。講演の大筋はマクロはコード生成、静的な検査、および DSL に有効であるということで、これを研究や産業からの例を交えながら説明した。

Scala'13 ワークショップにおいて ["Scala Macros: Let Our Powers Combine!"](https://scalamacros.org/paperstalks/2013-04-22-LetOurPowersCombine.pdf) という論文を発表した。これは Scala 2.10 における最先端のマクロ論をより学問的な視点から説明した。
Scala'13 ワークショップにおいて ["Scala Macros: Let Our Powers Combine!"](https://github.com/scalamacros/scalamacros.github.com/blob/5904f7ef88a439c668204b4bf262835e89fb13cb/paperstalks/2013-04-22-LetOurPowersCombine.pdf) という論文を発表した。これは Scala 2.10 における最先端のマクロ論をより学問的な視点から説明した。
この論文では Scala のリッチな構文と静的な型がマクロと相乗することを示し、また既存の言語機能をマクロによって新しい方法で活用できることを考察する。
2 changes: 1 addition & 1 deletion _ja/overviews/reflection/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Scala コンパイラが持つ型情報を全ては入手できない可能性

上の例では、まず `scala.reflect.runtime.universe` をインポートして
(型タグを使うためには必ずインポートされる必要がある)、`l` という名前の `List[Int]` を作る。
次に、context bound を持った型パラメータ `T` を持つ `getTypeTag` というメソッドは定義する
次に、context bound を持った型パラメータ `T` を持つ `getTypeTag` というメソッドを定義する
(REPL が示すとおり、これは暗黙の evidence パラメータを定義することに等価であり、コンパイラは `T` に対する型タグを生成する)。
最後に、このメソッドに `l` を渡して呼び出し、`TypeTag` に格納される型を返す `tpe` を呼び出す。
見ての通り、正しい完全な型 (つまり、`List` の具象型引数を含むということ) である `List[Int]` が返ってきた。
Expand Down
Loading

0 comments on commit e4fa32b

Please sign in to comment.