At a higher level, you seem to be doing something that involves a lot of metaprogramming. Can you say a little more about the higher level goal and why it entails so much macrology?
On Thu, Feb 11, 2016 at 4:37 PM, Julia Tylors <juliatyl...@gmail.com> wrote: > Hi; > > > I am having a problem of calling a macro with predetermined values from a > Dictionary. > How do i solve this problem? > > Thanks > > > module X > const cmds = Dict{Symbol,Symbol}( > :L => :leech, :R => :raise > ) > > macro fun_gen(fname,label) > efname = esc(fname) > elabel = esc(label) > quote > function $(efname)() > $elabel > end > export $(efname) > end > end > > for kv in cmds > @fun_gen kv[2] kv[1] > end > end > > but this doesn't work. > > because @fun_gen exactly takes them as kv[2] kv[1] > > How can i do this? > and what is the exact problem here? > > Thanks >