Skip to content

Commit f822161

Browse files
committed
Clean up grammar and other nit issues in macros.md
1 parent 19bbd02 commit f822161

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

_overviews/scala3-macros/tutorial/macros.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ As a technicaly consequence, we cannot define and use a macro in the **same clas
7373
However, it is possible to have the macro definition and its call in the **same project** as long as the implementation of the macro can be compiled first.
7474

7575
> ##### Suspended Files
76-
> To allow defining and using macros in the same project, only those calls to macros are expanded, where the macro has already been compiled.
76+
> To allow defining and using macros in the same project, only those calls to macros that have already been compiled are expanded.
7777
> For all other (unknown) macro calls, the compilation of the file is _suspended_.
7878
> Suspended files are only compiled after all non suspended files have been successfully compiled.
7979
> In some cases, you will have _cyclic dependencies_ that will block the completion of the compilation.
@@ -206,7 +206,7 @@ def sumCode(nums: Expr[Seq[Int]])(using Quotes): Expr[Int] =
206206
The extractor will match a call to `sumNow(1, 2, 3)` and extract a `Seq[Expr[Int]]` containing the code of each parameter.
207207
But, if we try to match the argument of the call `sumNow(nums: _*)`, the extractor will not match.
208208

209-
`Varargs` can also be used as a constructor, `Varargs(Expr(1), Expr(2), Expr(3))` will return a `Expr[Seq[Int]]`.
209+
`Varargs` can also be used as a constructor. `Varargs(Expr(1), Expr(2), Expr(3))` will return an `Expr[Seq[Int]]`.
210210
We will see how this can be useful later.
211211

212212

@@ -226,8 +226,8 @@ while subsequent chapters introduce the more advanced APIs.
226226
### Collections
227227

228228
We have seen how to convert a `List[Int]` into an `Expr[List[Int]]` using `Expr.apply`.
229-
How about converting a `List[Expr[Int]]` into `Expr[List[Int]]`?
230-
We mentioned that `Varargs.apply` can do this for sequences -- likewise for other collection types, corresponding methods are available:
229+
How about converting a `List[Expr[Int]]` into an `Expr[List[Int]]`?
230+
We mentioned that `Varargs.apply` can do this for sequences; likewise, for other collection types, corresponding methods are available:
231231

232232
* `Expr.ofList`: Transform a `List[Expr[T]]` into `Expr[List[T]]`
233233
* `Expr.ofSeq`: Transform a `Seq[Expr[T]]` into `Expr[Seq[T]]` (just like `Varargs`)
@@ -269,7 +269,7 @@ Note, that `matches` only performs a limited amount of normalization and while f
269269
### Arbitrary Expressions
270270

271271
Last but not least, it is possible to create an `Expr[T]` from arbitary Scala code by enclosing it in [quotes][quotes].
272-
For example `'{ ${expr}; true }` will generate an `Expr[Int]` equivalent to `Expr.block(List(expr), Expr(true))`.
272+
For example, `'{ ${expr}; true }` will generate an `Expr[Int]` equivalent to `Expr.block(List(expr), Expr(true))`.
273273
The subsequent section on [Quoted Code][quotes] presents quotes in more detail.
274274

275275
[contributing]: {% link scala3/contribute-to-docs.md %}

0 commit comments

Comments
 (0)