JuliaStaging / JuliaStaging/JuliaVariables.jl

Macro arguments are treated as globals

Open
#10 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Julia
Stars
28
Forks
5
PR merge metrics
No merged PRs in 30d

Description

It seems that macro arguments are treated as globals (see `@global x`)

```julia
julia> solve(:(macro f(x) end))
:(macro (@global f)(@global x)
#= REPL[12]:1 =#
end)
```

Compare this to a function:

```julia
julia> solve(:(function f(x) end))
[]function (@global f)(@x)
#= REPL[13]:1 =#
end
```

Also, `macro (@global f)` is a bit hard to use. Would `@global var"@f"` make sense?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.