Skip to content

Commit d7ee473

Browse files
authored
doc(multi-staging): fix typos
1 parent 811dc19 commit d7ee473

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/docs/reference/metaprogramming/staging.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@ multi-staging programming. We can think of compile-time meta-programming as a
88
two stage compilation process: one that we write the code in top-level splices,
99
that will be used for code generation (macros) and one that will perform all
1010
necessecary evaluations at compile-time and an object program that we will run
11-
as usual. What if we could synthesize code at runtime and offer one extra stage
12-
to the programmer? Then we can have a value of type `Expr[T]` at runtime that we
11+
as usual. What if we could synthesize code at run-time and offer one extra stage
12+
to the programmer? Then we can have a value of type `Expr[T]` at run-time that we
1313
can essentially treat as a typed-syntax tree that we can either _show_ as a
1414
string (pretty-print) or compile and run. If the number of quotes exceeds the
15-
number of splices more than one (effectively handling at run-time values of type
16-
`Expr[Expr[T]]`, `Expr[Expr[Expr[T]]]`, ... we talk about Multi-Stage
17-
Programming).
15+
number of splices by more than one (effectively handling at run-time values of type
16+
`Expr[Expr[T]]`, `Expr[Expr[Expr[T]]]`, ...) then we talk about Multi-Stage
17+
Programming.
1818

1919
The motivation behind this _paradigm_ is to let runtime information affect or
2020
guide code-generation.
2121

2222
Intuition: The phase in which code is run is determined by the difference
2323
between the number of splice scopes and quote scopes in which it is embedded.
2424

25-
- If there are more splices than quotes, the code is run at "compile-time" i.e.
25+
- If there are more splices than quotes, the code is run at compile-time i.e.
2626
as a macro. In the general case, this means running an interpreter that
2727
evaluates the code, which is represented as a typed abstract syntax tree. The
2828
interpreter can fall back to reflective calls when evaluating an application
29-
of a previously compiled method. If the splice excess is more than one, it
29+
of a previously compiled method. If the splice excess is more than one, it
3030
would mean that a macro’s implementation code (as opposed to the code it
3131
expands to) invokes other macros. If macros are realized by interpretation,
3232
this would lead to towers of interpreters, where the first interpreter would
@@ -61,7 +61,7 @@ to be executed at a later stage. To run that code, there is another method
6161
in class `Expr` called `run`. Note that `$` and `run` both map from `Expr[T]`
6262
to `T` but only `$` is subject to the PCP, whereas `run` is just a normal method.
6363
Run provides a `QuoteContext` that can be used to show the expression in the scope of `run`.
64-
On the other hand `withQuoteContext` provides a `QuoteContext` without evauating the expression.
64+
On the other hand `withQuoteContext` provides a `QuoteContext` without evaluating the expression.
6565

6666
```scala
6767
package scala.quoted.staging

0 commit comments

Comments
 (0)