nimscripter
nimscripter copied to clipboard
make exported stuffs available in other scripts
proc exportedHi = echo "hi"
exportTo(
moduleName,
exportedHi
)
const addins = implNimScriptModule(moduleName)
var intr = loadScript(
script = NimScriptPath "./main.nims",
addins = addins
)
# main.nims
import "./helper.nims"
hi()
# helper.nims
proc hi = exportedHi() # <-- error: this proc is unavailable
I want to make a nimscript helper module but I can't use the exported procs
I can use include instead but I want to avoid that.
Is there any way to achieve this? or do you know a better way to make a helper nimscript?
https://github.com/beef331/nimscripter/blob/master/src/nimscripter.nim#L87-L90 Need a version that takes in a openarray[(string, VMAddins)] or similar and implements each per string.