您可以provide在模块中使用将定义导出到导入它的其他模块require:
;; a.rkt
(provide f)
(define (f x)
(displayln (add1 x)))
;; b.rkt
(require "a.rkt")
(f 3) ; => 4
Run Code Online (Sandbox Code Playgroud)
有关更多信息,请参阅文档.
| 归档时间: |
|
| 查看次数: |
612 次 |
| 最近记录: |