Skip to content

Instantly share code, notes, and snippets.

@xrq-phys
Last active September 25, 2020 16:50
Show Gist options
  • Select an option

  • Save xrq-phys/e83e1a98929e6a0061d77b41af14de73 to your computer and use it in GitHub Desktop.

Select an option

Save xrq-phys/e83e1a98929e6a0061d77b41af14de73 to your computer and use it in GitHub Desktop.

Revisions

  1. xrq-phys revised this gist Sep 25, 2020. No changes.
  2. xrq-phys created this gist Sep 25, 2020.
    15 changes: 15 additions & 0 deletions batch_define.jl
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    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