gpt4 book ai didi

include - Racket 方案 : Include externel rkt file with dynamic file name

转载 作者:行者123 更新时间:2023-12-04 03:41:19 25 4
gpt4 key购买 nike

我想从函数的参数加载 Racket 方案中的外部 rkt 文件。例如,

(define (test fileName)
(include fileName)
)

但是,我收到错误消息,指出 fileName 不是路径名字符串、file' 形式或 lib' 形式。

有没有办法解决这个问题,或者有其他更好的方法来包含来自动态文件名的文件?

最佳答案

最好的方法是将外部文件变成一个模块,然后使用dynamic-require。 .

关于include - Racket 方案 : Include externel rkt file with dynamic file name,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15467117/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com