-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs/reference] fixed many issues in MarkDown files #10767
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -122,7 +122,8 @@ most (but not all) divergence errors in Scala 2 would terminate the implicit sea | |||
def buzz(y: A) = ??? | |||
buzz(1) // error: ambiguous | |||
``` | |||
**7.** The rule for picking a _most specific_ alternative among a set of overloaded or implicit alternatives is refined to take context parameters into account. All else being equal, an alternative that takes some context parameters is taken to be less specific than an alternative that takes none. If both alternatives take context parameters, we try to choose between them as if they were methods with regular parameters. The following paragraph in the SLS is affected by this change: | |||
**7.** The rule for picking a _most specific_ alternative among a set of overloaded or implicit alternatives is refined to take context parameters into account. All else being equal, an alternative that takes some context parameters is taken to be less specific than an alternative that takes none. If both alternatives take context parameters, we try to choose between them as if they were methods with regular parameters. The following paragraph in the [SLS § | |||
6.26.3](https://scala-lang.org/files/archive/spec/2.13/06-expressions.html#overloading-resolution) is affected by this change: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the new line inside the brackets introduced by accident?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By accident. I'll remove the new line.
@@ -33,7 +33,8 @@ g(2)(3)(4) // ok | |||
g(2)(3)("") // ok | |||
``` | |||
|
|||
To make this work, the rules for overloading resolution in section 6.23.3 of the SLS are augmented | |||
To make this work, the rules for overloading resolution in [SLS § | |||
6.26.3](https://www.scala-lang.org/files/archive/spec/2.13/06-expressions.html#overloading-resolution) are augmented |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question as above?
@@ -57,7 +58,8 @@ def f(x: String, f2: String => String) = f2(x) | |||
f("a", _.toUpperCase) | |||
f(2, _ * 2) | |||
``` | |||
To make this work, the rules for overloading resolution in section 6.23.3 of the SLS are modified | |||
To make this work, the rules for overloading resolution in [SLS § | |||
6.26.3](https://www.scala-lang.org/files/archive/spec/2.13/06-expressions.html#overloading-resolution) are modified |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question as above?
@@ -49,7 +49,7 @@ The following pages introduce a redesign of contextual abstractions in Scala. Th | |||
|
|||
1. [Given Instances](./givens.md) are a new way to define basic terms that can be synthesized. They replace implicit definitions. The core principle of the proposal is that, rather than mixing the `implicit` modifier with a large number of features, we have a single way to define terms that can be synthesized for types. | |||
|
|||
2. [Using Clauses](./using-clauses.md) are a new syntax for implicit _parameters_ and their _arguments_. It unambiguously aligns parameters and arguments, solving a number of language warts. It also allows us to have several `using` clauses in a definition. | |||
2. [`using` Clauses](./using-clauses.md) are a new syntax for implicit _parameters_ and their _arguments_. It unambiguously aligns parameters and arguments, solving a number of language warts. It also allows us to have several `using` clauses in a definition. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change will make it inconsistent to the first item.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll revert that change.
@@ -683,21 +646,20 @@ private def sumExpr(argsExpr: Expr[Seq[Int]])(using Quotes): Expr[Int] = argsExp | |||
// argValues is of type Seq[Int] | |||
Expr(argValues.sum) // precompute result of sum | |||
case Varargs(argExprs) => // argExprs is of type Seq[Expr[Int]] | |||
val staticSum: Int = argExprs.map(_.value.getOrElse(0)).sum | |||
val staticSum: Int = argExprs.map(_.value.getOrElse(0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accidental removal of .sum
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've found two other diffs.. I need to update my file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liufengyun metaprogramming/macros.md
needs closer revue. Otherwise looks good.
@@ -602,7 +566,6 @@ sum | |||
``` | |||
|
|||
Finally cleanups and dead code elimination: | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this file, the blank lines before and after code blocks are removed in some cases. Is this by accident?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my experience it doesn't make any difference with top-level paragraphs, but it does with indented text (eg. list items). I'll revert the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @michelou 🎉
@michelou nice. is that officially hosted anywhere? |
@SethTisue No (at least not for now although the provided link will stay as I already have more changes to submit). I generate the Scala 3 reference as PDF document because it's much easier to read and to review but :
PS. Tech recipe: addition of two files |
cool, thanks for explaining. I think it would be great to make a PDF version more openly available, eventually — I've totally bookmarked this one and expect I'll refer to it often. (in Scala 2 land, scala/bug#10218 was a very popular ask for a long time) |
Fixes mostly formatting issues found in MarkDown files in
docs/reference/
, e.g,.md
instead of.html
, e.g../enums.html
becomes./enums.md
)metaprogramming/inline.md
)title
variable (in MarkDown header) if value contains a colon (:
)This change needs to be validated:
"../../internals/syntax.md"
to"../syntax.md"
PS. The result of the above changes can be viewed in the PDF document
scala3_reference.pdf
(704 Kb) generated with Pandoc 2.11.