Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jw3126 committed Jun 30, 2017
1 parent f129064 commit 97a4968
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions base/expr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,12 @@ Return equivalent expression with all macros removed (expanded).
There are differences between `@macroexpand` and [`macroexpand`](@ref).
* While [`macroexpand`](@ref) takes a keyword argument `recursive`, `@macroexpand` is always recursive. For a non recursive macro version, see [`@macroexpand1`](@ref).
* While [`macroexpand`](@ref) takes a keyword argument `recursive`, `@macroexpand`
is always recursive. For a non recursive macro version, see [`@macroexpand1`](@ref).
* While [`macroexpand`](@ref) has an explicit `module` argument, `@macroexpand` always expands with respect to the module in which it is called. This is best seen in the following example:
* While [`macroexpand`](@ref) has an explicit `module` argument, `@macroexpand` always
expands with respect to the module in which it is called.
This is best seen in the following example:
```jldoctest
julia> module M
macro m()
Expand All @@ -119,7 +122,8 @@ julia> macro m()
julia> M.f()
(1, 1, 2)
```
With `@macroexpand` the expression expands where `@macroexpand` appears in the code (module `M` in the example). With `macroexpand` the expression expands in the module given as the first argument.
With `@macroexpand` the expression expands where `@macroexpand` appears in the code (module `M` in the example).
With `macroexpand` the expression expands in the module given as the first argument.
"""
macro macroexpand(code)
return :(macroexpand($__module__, $(QuoteNode(code)), recursive=true))
Expand Down

0 comments on commit 97a4968

Please sign in to comment.