I am trying to make something like the following:
macro gen_function(plugin:string, functionName:string) =
var source = fmt"""
proc {functionName}():ptr VSMap =
let plug = getPluginById("{plugin}")
let args = createMap()
return API.invoke(plug, "{functionName}".cstring, args)
"""
result = parseStmt(source)
when isMainModule:
let plugins = getPlugins()
for plugin in plugins:
if plugin[0] == "ffms2":
for f in plugin[3]:
gen_function( plugin[1], f[0])
Run
- Creating functions at runtime mantielero
- Re: Creating functions at runtime Hlaaftana
- Re: Creating functions at runtime mantielero
- Re: Creating functions at runtime mantielero
- Re: Creating functions at runtime jyapayne
- Re: Creating functions at runtime shashlick
- Re: Creating functions at runtime mantielero
