Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make exported stuffs available in other scripts #17

Open
doongjohn opened this issue May 15, 2022 · 1 comment
Open

make exported stuffs available in other scripts #17

doongjohn opened this issue May 15, 2022 · 1 comment

Comments

@doongjohn
Copy link

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?

@beef331
Copy link
Owner

beef331 commented May 15, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants