Skip to content

Commit 0ef144c

Browse files
author
Tomas Pevny
committed
fixing
1 parent 5f6a681 commit 0ef144c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

docs/src/lectures/lecture_07/lecture.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ CodeInfo(
7575
```
7676

7777
::: info Scope of eval
78-
`eval` function is always evaluated in the global scope of the `Module` in which the macro is called (note that there is that by default you operate in the `Main` module). Moreover, `eval` takes effect **after** the function has been has been executed. This can be demonstrated as
78+
`eval` function is always evaluated in the global scope of the `Module` in which it is called (note that there is that by default you operate in the `Main` module). Moreover, `eval` takes effect **after** the function has been has been executed. This can be demonstrated as
7979
```julia
8080
add1(x) = x + 1
8181
function redefine_add(x)
@@ -87,9 +87,9 @@ CodeInfo(
8787

8888
julia> redefine_add(1)
8989
0
90-
9190
```
9291

92+
9393
Macros are quite tricky to debug. Macro `@macroexpand` allows to observe the expansion of macros. Observe the effect as
9494
```julia
9595
@macroexpand @replace_sin(cosp1(x) = 1 + sin(x))
@@ -160,7 +160,6 @@ end
160160
```
161161
(the `@showarg(1 + 1, :x)` raises an error, since `:(:x)` is of Type `QuoteNode`).
162162

163-
164163
Observe that macro dispatch is based on the types of AST that are handed to the macro, not the types that the AST evaluates to at runtime.
165164

166165
List of all defined versions of macro

0 commit comments

Comments
 (0)