Skip to content

Commit c37dde7

Browse files
Aggelos Biboudisnicolasstucki
Aggelos Biboudis
andauthored
Apply suggestions from code review
LGTM Co-Authored-By: Nicolas Stucki <nicolas.stucki@gmail.com>
1 parent f22c451 commit c37dde7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

docs/docs/reference/metaprogramming/staging.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ impose the following restrictions on the use of splices.
5353

5454
3. Splices inside splices (but no intervening quotes) are not allowed.
5555

56-
4. A macro method is effectively final and it may override no other method.
5756

5857
## API
5958

@@ -81,16 +80,16 @@ either show the code or run it respectivelly.
8180
// make available the necessary toolbox for runtime code generation
8281
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
8382
84-
val sum_s: Expr[Array[Int] => Int] = '{ (arr: Array[Int]) => ${sum('arr)}}
83+
val stagedSum: Expr[Array[Int] => Int] = '{ (arr: Array[Int]) => ${sum('arr)}}
8584
86-
println(sum_s.show)
85+
println(stagedSum.show)
8786
88-
sum_s.run.apply(Array(1, 2, 3)) // Returns 6
87+
stagedSum.run.apply(Array(1, 2, 3)) // Returns 6
8988
```
9089

9190
Note that if we need to run the main (in an object called `Test`) after
9291
compilation we need make available the compiler to the runtime:
9392

9493
```shell
9594
sbt:dotty> dotr -classpath out -with-compiler Test
96-
```
95+
```

0 commit comments

Comments
 (0)