Skip to content

Instantly share code, notes, and snippets.

@slycoder
Last active January 1, 2016 12:18
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 slycoder/8143200 to your computer and use it in GitHub Desktop.
Save slycoder/8143200 to your computer and use it in GitHub Desktop.
Better example. I understand macros now I think.
macro singleton(ex)
v = eval(ex)
:($v)
end
function demo()
y = @singleton zeros(Int64, 1000000)
for ii in 1:1000000
@inbounds y[ii] += 3
end
return y
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment