Skip to content

Instantly share code, notes, and snippets.

@Wilfred
Created September 7, 2014 00:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wilfred/4431fcb716feb3c20387 to your computer and use it in GitHub Desktop.
Save Wilfred/4431fcb716feb3c20387 to your computer and use it in GitHub Desktop.
A simple swap macro
ERROR: b not defined
in include at boot.jl:245
in include_from_node1 at loading.jl:128
in process_options at client.jl:285
in _start at client.jl:354
while loading /home/wilfred/projects/comparative_macrology/swap.jl, in expression starting on line 3
macro swap!(x, y)
quote
tmp = $y
$x = $y
$y = tmp
end
end
a = 1
b = 2
# Runs fine if I comment out this line
@swap!(a, b)
println("a: $a, b: $b")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment