Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use words from a named module inside another?

Tags:

rebol

rebol3

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

like image 684
Graham Chiu Avatar asked Dec 08 '25 09:12

Graham Chiu


1 Answers

;in module1

word1: ...

;in module2

mod1: import 'module1

word1: :mod1/word1

like image 86
giuliolunati Avatar answered Dec 11 '25 12:12

giuliolunati



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!