3

I'm looking for an example of how to use words exported from a named module inside another module.

From the help of import

REFINEMENTS:
/version
ver [tuple!]
    Module must be this version or greater
/check
sum [binary!]
    Match checksum (must be set in header)
/no-share
    Force module to use its own non-shared global namespace
/no-lib
    Don't export to the runtime library (lib)
/no-user
    Don't export to the user context

it would suggest that import/no-lib doesn't place the imported word in the lib context, so import by itself should? But it doesn't.

This works but it seems that import by itself should work.

import/no-lib %my-named-module.reb
append lib compose [f: (:my-exported-function))

and I can then access the function by using lib/f

Graham Chiu
  • 4,856
  • 1
  • 23
  • 41

1 Answers1

1

;in module1

word1: ...

;in module2

mod1: import 'module1

word1: :mod1/word1

giuliolunati
  • 766
  • 5
  • 14