Skip to content

Commit af94cfc

Browse files
authored
Merge pull request #6630 from dotty-staging/fix-docs-terminology
Tweaks to terminology in docs
2 parents fe02bf4 + 7f9b55e commit af94cfc

File tree

6 files changed

+26
-20
lines changed

6 files changed

+26
-20
lines changed

docs/docs/reference/contextual/import-implied.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import delegate A.{for TC}
3939
This imports any delegate in `A` that has a type which conforms tp `TC`. There can be several bounding types following a `for` and bounding types can contain wildcards.
4040
For instance, assuming the object
4141
```scala
42-
object Instances {
42+
object Delegates {
4343
delegate intOrd for Ordering[Int]
4444
delegate [T: Ordering] listOrd for Ordering[List[T]]
4545
delegate ec for ExecutionContext = ...
@@ -48,7 +48,7 @@ object Instances {
4848
```
4949
the import
5050
```
51-
import delegate Instances.{for Ordering[_], ExecutionContext}
51+
import delegate Delegates.{for Ordering[_], ExecutionContext}
5252
```
5353
would import the `intOrd`, `listOrd`, and `ec` delegates but leave out the `im` delegate, since it fits none of the specified bounds.
5454

docs/docs/reference/features-classification.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ These new constructs directly model core features of DOT, higher-kinded types, a
2121
- [Type lambdas](https://dotty.epfl.ch/docs/reference/new-types/type-lambdas.html),
2222
replacing encodings using structural types and type projection.
2323
- [Context Queries](https://dotty.epfl.ch/docs/reference/contextual/query-types.html)
24-
(_aka_ implicit function types) offering abstraction over inferable parameters.
24+
(_aka_ implicit function types) offering abstraction over given parameters.
2525

2626
**Status: essential**
2727

@@ -36,9 +36,9 @@ Since these are additions, there's generally no migration cost for old code. An
3636
These constructs replace existing constructs with the aim of making the language safer and simpler to use, and to promote uniformity in code style.
3737

3838
- [Trait Parameters](https://dotty.epfl.ch/docs/reference/other-new-features/trait-parameters.html) replace [early initializers](https://dotty.epfl.ch/docs/reference/dropped-features/early-initializers.html) with a more generally useful construct.
39-
- [Implied Instances](https://dotty.epfl.ch/docs/reference/contextual/instance-defs.html)
39+
- [Delegates](https://dotty.epfl.ch/docs/reference/contextual/instance-defs.html)
4040
replace implicit objects and defs, focussing on intent over mechanism.
41-
- [Inferable parameters](https://dotty.epfl.ch/docs/reference/contextual/inferable-params.html) replace implicit parameters, avoiding their ambiguities.
41+
- [Given Clauses](https://dotty.epfl.ch/docs/reference/contextual/inferable-params.html) replace implicit parameters, avoiding their ambiguities.
4242
- [Extension Methods](https://dotty.epfl.ch/docs/reference/contextual/extension-methods.html) replace implicit classes with a clearer and simpler mechanism.
4343
- [Opaque Type Aliases](https://dotty.epfl.ch/docs/reference/other-new-features/opaques.html) replace most uses
4444
of value classes while guaranteeing absence of boxing.
@@ -71,7 +71,7 @@ For the next several versions, old features will remain available and deprecatio
7171
These constructs are restricted to make the language safer.
7272

7373
- [Implicit Conversions](https://dotty.epfl.ch/docs/reference/contextual/conversions.html): there is only one way to define implicit conversions instead of many, and potentially surprising implicit conversions require a language import.
74-
- [Implied Imports](https://dotty.epfl.ch/docs/reference/contextual/import-implied.html): implicits now require a special form of import, to make the import clearly visible.
74+
- [Delegate Imports](https://dotty.epfl.ch/docs/reference/contextual/import-implied.html): implicits now require a special form of import, to make the import clearly visible.
7575
- [Type Projection](https://dotty.epfl.ch/docs/reference/dropped-features/type-projection.html): only classes can be used as prefix `C` of a type projection `C#A`. Type projection on abstract types is no longer supported since it is unsound.
7676
- [Multiversal Equality](https://dotty.epfl.ch/docs/reference/contextual/multiversal-equality.html) implements an "opt-in" scheme to rule out nonsensical comparisons with `==` and `!=`.
7777
- [@infix and @alpha](https://github.com/lampepfl/dotty/pull/5975)

docs/docs/reference/metaprogramming/inline.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,20 @@ In the `true` case the code will be rewritten to:
7979
def factorial(n: BigInt): BigInt = {
8080
val msg = s"factorial($n)"
8181
println(s"${" " * indent}start $msg")
82-
Logger.inline$indent += indentSetting
82+
Logger.inline$indent_=(indent.+(indentSetting))
8383
val result =
8484
if (n == 0) 1
8585
else n * factorial(n - 1)
86-
Logger.inline$indent -= indentSetting
86+
Logger.inline$indent_=(indent.-(indentSetting))
8787
println(s"${" " * indent}$msg = $result")
8888
result
8989
}
9090
```
9191

9292
Note, that the by-value parameter is evaluated only once, per the usual Scala
9393
semantics, by binding the value and reusing the `msg` through the body of
94-
`factorial`.
94+
`factorial`. Also, note the special handling of setting to the private var
95+
`indent` by generating the setter method `def inline$indent_=`.
9596

9697
### Recursive Inline Methods
9798

docs/docs/reference/metaprogramming/macros.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -586,13 +586,4 @@ val a: Int = defaultOf("int")
586586
val b: String = defaultOf("string")
587587
```
588588

589-
### Let
590-
591-
`scala.tasty.reflect.utils.TreeUtils` offers a method `let` that allows us to
592-
bind the `rhs` to a `val` and use it in `body`. Its definition is shown below:
593-
594-
```scala
595-
def let(rhs: Term)(body: Ident => Term): Term
596-
```
597-
598589
[More details](./macros-spec.html)

docs/docs/reference/metaprogramming/tasty-reflect.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,20 @@ def collectPatternVariables(tree: Tree)(implicit ctx: Context): List[Symbol] = {
139139
A `TreeTraverser` extends a `TreeAccumulator` and performs the same traversal
140140
but without returning any value. Finally a `TreeMap` performs a transformation.
141141

142+
#### Let
143+
144+
`scala.tasty.reflect.utils.TreeUtils` also offers a method `let` that allows us
145+
to bind the `rhs` to a `val` and use it in `body`. Additionally, `lets` binds
146+
the given `terms` to names and use them in the `body`. Their type definitions
147+
are shown below:
148+
149+
```scala
150+
def let(rhs: Term)(body: Ident => Term): Term = ...
151+
152+
def lets(terms: List[Term])(body: List[Term] => Term): Term = ...
153+
```
154+
155+
142156
## TASTy Reflect API
143157

144158
TASTy Reflect provides the following types:

docs/docs/reference/overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ These new constructs directly model core features of DOT, higher-kinded types, a
2525
- [Union types](https://dotty.epfl.ch/docs/reference/new-types/union-types.html),
2626
- [Type lambdas](https://dotty.epfl.ch/docs/reference/new-types/type-lambdas.html),
2727
replacing encodings using structural types and type projection.
28-
- [Implicit Function Types](https://dotty.epfl.ch/docs/reference/contextual/query-types.html)
29-
offering abstraction over implicit parameters.
28+
- [Context Queries](https://dotty.epfl.ch/docs/reference/contextual/query-types.html)
29+
(_aka_ implicit function types) offering abstraction over implicit parameters.
3030

3131
## Simplifications
3232

0 commit comments

Comments
 (0)