You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of having a special concept to extract values out of sequences,
with this change, we can take advantage of composition with `Exprs`.
The old `ConstSeq` and `ValueSeq` are deprecated to reduce the sumber of concepts in the API.
Copy file name to clipboardExpand all lines: docs/docs/reference/metaprogramming/macros.md
+3-5Lines changed: 3 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -616,17 +616,15 @@ It is possible to deconstruct or extract values out of `Expr` using pattern matc
616
616
617
617
`scala.quoted` contains objects that can help extracting values from `Expr`.
618
618
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.
619
+
*`scala.quoted.Const`: matches an expression of a literal value (or list of values) and returns the value (or list of values).
620
+
*`scala.quoted.Value`: matches an expression of a value (or list of values) and returns the value (or list of values).
621
621
*`scala.quoted.Exprs`: 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.
624
622
625
623
These could be used in the following way to optimize any call to `sum` that has statically known values.
0 commit comments