Skip to content

Commit

Permalink
hygiene in chain macro
Browse files Browse the repository at this point in the history
  • Loading branch information
pluskid committed Oct 23, 2015
1 parent 43b2486 commit 02e4af3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/symbol.jl
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,10 @@ macro chain(layers)
last_layer = nothing
function _chain_layer(layer, last_layer)
if isa(last_layer, Void)
layer
esc(layer)
else
@assert(isa(layer, Expr) && layer.head == :call, "Do not know how to chain up $layer")
return Expr(:call, layer.args[1], last_layer, layer.args[2:end]...)
return Expr(:call, esc(layer.args[1]), last_layer, map(esc, layer.args[2:end])...)
end
end
while true
Expand Down

0 comments on commit 02e4af3

Please sign in to comment.