Skip to content

Commit f8e65de

Browse files
authored
Merge pull request #8374 from robstoll/patch-33
doc(macros): fix expansion and some improvements
2 parents 84ea41a + 8df5b70 commit f8e65de

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/docs/reference/metaprogramming/macros.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ val program = {
377377
${ Macros.assertImpl('{ x != 0) } }
378378
}
379379
```
380-
The example is only phase correct because Macros is a global value and
380+
The example is only phase correct because `Macros` is a global value and
381381
as such not subject to phase consistency checking. Conceptually that’s
382382
a bit unsatisfactory. If the PCP is so fundamental, it should be
383383
applicable without the global value exception. But in the example as
@@ -529,7 +529,7 @@ val arr: Array[Int] = Array.apply(1, [2,3 : Int]:Int*)
529529

530530
var sum = 0
531531
val f = x => '{sum += $x}
532-
${ _root_.Macros.map(arr, '[Int], 'f)}
532+
${ _root_.Macros.map(arr, 'f)('[Int])}
533533
sum
534534
```
535535

@@ -616,10 +616,10 @@ It is possible to deconstruct or extract values out of `Expr` using pattern matc
616616

617617
#### scala.quoted.matching
618618

619-
In `scala.quoted.matching` contains object that can help extract values from `Expr`.
619+
`scala.quoted.matching` contains objects that can help extracting values from `Expr`.
620620

621-
* `scala.quoted.matching.Const`: matches an expression a literal value and returns the value.
622-
* `scala.quoted.matching.Value`: matches an expression a value and returns the value.
621+
* `scala.quoted.matching.Const`: matches an expression of a literal value and returns the value.
622+
* `scala.quoted.matching.Value`: matches an expression of a value and returns the value.
623623
* `scala.quoted.matching.ExprSeq`: matches an explicit sequence of expresions and returns them. These sequences are useful to get individual `Expr[T]` out of a varargs expression of type `Expr[Seq[T]]`.
624624
* `scala.quoted.matching.ConstSeq`: matches an explicit sequence of literal values and returns them.
625625
* `scala.quoted.matching.ValueSeq`: matches an explicit sequence of values and returns them.

0 commit comments

Comments
 (0)