【问题标题】:How to use words from a named module inside another?如何在另一个命名模块中使用单词?
【发布时间】:2017-08-05 10:15:18
【问题描述】:

我正在寻找如何在另一个模块中使用从命名模块导出的单词的示例。

借助导入

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

这表明 import/no-lib 不会将导入的单词放在 lib 上下文中,因此 import 本身应该?但事实并非如此。

这可行,但似乎导入本身应该可行。

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

然后我可以使用 lib/f 访问该函数

【问题讨论】:

  • 你见过this Q/A吗?
  • @giuliolunati 我认为它不像描述的那样工作。出口不作为一个词存在。

标签: rebol rebol3


【解决方案1】:

;在模块 1 中

单词1:...

;在模块2中

mod1: 导入'module1

word1: :mod1/word1

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多