Skip to content

Instantly share code, notes, and snippets.

@xrq-phys
Last active September 25, 2020 16:50
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 xrq-phys/e83e1a98929e6a0061d77b41af14de73 to your computer and use it in GitHub Desktop.
Save xrq-phys/e83e1a98929e6a0061d77b41af14de73 to your computer and use it in GitHub Desktop.
Example of batch defining Julia functions. Will be used in BLIS.jl
module BatchDef
macro def_numed_fun(funname, num)
numed_funname = Symbol(string(funname, num))
@show numed_funname
return quote
$(esc(numed_funname))() = $num
end
end
@def_numed_fun("testfun", 1);
@def_numed_fun("testfun", 2);
@def_numed_fun("testfun", 3);
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment