Skip to content

Commit 44f6bd3

Browse files
committed
Update docs
1 parent cde1464 commit 44f6bd3

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

docs/docs/reference/metaprogramming/macros.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -565,13 +565,13 @@ sum
565565
### Find implicits within a macro
566566

567567
Similarly to the `summonFrom` construct, it is possible to make implicit search available
568-
in a quote context. For this we simply provide `scala.quoted.matching.summonExpr`:
568+
in a quote context. For this we simply provide `scala.quoted.Expr.summon`:
569569

570570
```scala
571571
inline def setFor[T]: Set[T] = ${ setForExpr[T] }
572572

573573
def setForExpr[T: Type](using QuoteContext): Expr[Set[T]] = {
574-
summonExpr[Ordering[T]] match {
574+
Expr.summon[Ordering[T]] match {
575575
case Some(ord) => '{ new TreeSet[T]()($ord) }
576576
case _ => '{ new HashSet[T] }
577577
}
@@ -614,15 +614,13 @@ In case all files are suspended due to cyclic dependencies the compilation will
614614

615615
It is possible to deconstruct or extract values out of `Expr` using pattern matching.
616616

617-
#### scala.quoted.matching
617+
`scala.quoted` contains objects that can help extracting values from `Expr`.
618618

619-
`scala.quoted.matching` contains objects that can help extracting values from `Expr`.
620-
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.
623-
* `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]]`.
624-
* `scala.quoted.matching.ConstSeq`: matches an explicit sequence of literal values and returns them.
625-
* `scala.quoted.matching.ValueSeq`: matches an explicit sequence of values and returns them.
619+
* `scala.quoted.Const`: matches an expression of a literal value and returns the value.
620+
* `scala.quoted.Value`: matches an expression of a value and returns the value.
621+
* `scala.quoted.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]]`.
622+
* `scala.quoted.ConstSeq`: matches an explicit sequence of literal values and returns them.
623+
* `scala.quoted.ValueSeq`: matches an explicit sequence of values and returns them.
626624

627625
These could be used in the following way to optimize any call to `sum` that has statically known values.
628626
```scala

0 commit comments

Comments
 (0)