Skip to content

Instantly share code, notes, and snippets.

@ihnorton

ihnorton/foo.jl Secret

Created July 28, 2015 17:27
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 ihnorton/498064798a67bcd1261f to your computer and use it in GitHub Desktop.
Save ihnorton/498064798a67bcd1261f to your computer and use it in GitHub Desktop.
push!(LOAD_PATH, "/cmn/jlbugs/1334_macro_lnos")
require("foo2")
function foo()
@show error("oops")
end
function foo2()
x = 1 + 1
y = 3 + x
@show error("oops")
m = x + y
end
function foo3()
x = 1 + 1
y = 3 + x
@show "ehlo"
@dofoo()
m = x + y
end
macro dobar()
blk = Expr(:block)
push!(blk.args, :(@show "hello, friend"))
quote
begin
$blk
end
end
end
macro dofoo()
blk = Expr(:block)
push!(blk.args, :(repr(throw("error"))))
quote
begin
$blk
end
begin
@dobar()
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment