Skip to content

Tweaks to terminology in docs #6630

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

Merged
merged 5 commits into from
Jun 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/docs/reference/contextual/import-implied.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import delegate A.{for TC}
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.
For instance, assuming the object
```scala
object Instances {
object Delegates {
delegate intOrd for Ordering[Int]
delegate [T: Ordering] listOrd for Ordering[List[T]]
delegate ec for ExecutionContext = ...
Expand All @@ -48,7 +48,7 @@ object Instances {
```
the import
```
import delegate Instances.{for Ordering[_], ExecutionContext}
import delegate Delegates.{for Ordering[_], ExecutionContext}
```
would import the `intOrd`, `listOrd`, and `ec` delegates but leave out the `im` delegate, since it fits none of the specified bounds.

Expand Down
8 changes: 4 additions & 4 deletions docs/docs/reference/features-classification.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ These new constructs directly model core features of DOT, higher-kinded types, a
- [Type lambdas](https://dotty.epfl.ch/docs/reference/new-types/type-lambdas.html),
replacing encodings using structural types and type projection.
- [Context Queries](https://dotty.epfl.ch/docs/reference/contextual/query-types.html)
(_aka_ implicit function types) offering abstraction over inferable parameters.
(_aka_ implicit function types) offering abstraction over given parameters.

**Status: essential**

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

- [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.
- [Implied Instances](https://dotty.epfl.ch/docs/reference/contextual/instance-defs.html)
- [Delegates](https://dotty.epfl.ch/docs/reference/contextual/instance-defs.html)
replace implicit objects and defs, focussing on intent over mechanism.
- [Inferable parameters](https://dotty.epfl.ch/docs/reference/contextual/inferable-params.html) replace implicit parameters, avoiding their ambiguities.
- [Given Clauses](https://dotty.epfl.ch/docs/reference/contextual/inferable-params.html) replace implicit parameters, avoiding their ambiguities.
- [Extension Methods](https://dotty.epfl.ch/docs/reference/contextual/extension-methods.html) replace implicit classes with a clearer and simpler mechanism.
- [Opaque Type Aliases](https://dotty.epfl.ch/docs/reference/other-new-features/opaques.html) replace most uses
of value classes while guaranteeing absence of boxing.
Expand Down Expand Up @@ -71,7 +71,7 @@ For the next several versions, old features will remain available and deprecatio
These constructs are restricted to make the language safer.

- [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.
- [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.
- [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.
- [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.
- [Multiversal Equality](https://dotty.epfl.ch/docs/reference/contextual/multiversal-equality.html) implements an "opt-in" scheme to rule out nonsensical comparisons with `==` and `!=`.
- [@infix and @alpha](https://github.com/lampepfl/dotty/pull/5975)
Expand Down
7 changes: 4 additions & 3 deletions docs/docs/reference/metaprogramming/inline.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,20 @@ In the `true` case the code will be rewritten to:
def factorial(n: BigInt): BigInt = {
val msg = s"factorial($n)"
println(s"${" " * indent}start $msg")
Logger.inline$indent += indentSetting
Logger.inline$indent_=(indent.+(indentSetting))
val result =
if (n == 0) 1
else n * factorial(n - 1)
Logger.inline$indent -= indentSetting
Logger.inline$indent_=(indent.-(indentSetting))
println(s"${" " * indent}$msg = $result")
result
}
```

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

### Recursive Inline Methods

Expand Down
9 changes: 0 additions & 9 deletions docs/docs/reference/metaprogramming/macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -586,13 +586,4 @@ val a: Int = defaultOf("int")
val b: String = defaultOf("string")
```

### Let

`scala.tasty.reflect.utils.TreeUtils` offers a method `let` that allows us to
bind the `rhs` to a `val` and use it in `body`. Its definition is shown below:

```scala
def let(rhs: Term)(body: Ident => Term): Term
```

[More details](./macros-spec.html)
14 changes: 14 additions & 0 deletions docs/docs/reference/metaprogramming/tasty-reflect.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,20 @@ def collectPatternVariables(tree: Tree)(implicit ctx: Context): List[Symbol] = {
A `TreeTraverser` extends a `TreeAccumulator` and performs the same traversal
but without returning any value. Finally a `TreeMap` performs a transformation.

#### Let

`scala.tasty.reflect.utils.TreeUtils` also offers a method `let` that allows us
to bind the `rhs` to a `val` and use it in `body`. Additionally, `lets` binds
the given `terms` to names and use them in the `body`. Their type definitions
are shown below:

```scala
def let(rhs: Term)(body: Ident => Term): Term = ...

def lets(terms: List[Term])(body: List[Term] => Term): Term = ...
```


## TASTy Reflect API

TASTy Reflect provides the following types:
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/reference/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ These new constructs directly model core features of DOT, higher-kinded types, a
- [Union types](https://dotty.epfl.ch/docs/reference/new-types/union-types.html),
- [Type lambdas](https://dotty.epfl.ch/docs/reference/new-types/type-lambdas.html),
replacing encodings using structural types and type projection.
- [Implicit Function Types](https://dotty.epfl.ch/docs/reference/contextual/query-types.html)
offering abstraction over implicit parameters.
- [Context Queries](https://dotty.epfl.ch/docs/reference/contextual/query-types.html)
(_aka_ implicit function types) offering abstraction over implicit parameters.

## Simplifications

Expand Down