在球拍中包含外部文件 [英] Including an external file in racket

查看:139
本文介绍了在球拍中包含外部文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想包含给定racket文件中定义的所有函数,以便获得与复制时相同的效果。是否可以这样做?

I would like to include all the functions defined in a given racket file so that I get the same effect as if they were copied. Is it possible to do that?

推荐答案

您可以使用 include 作为如下:

创建一个名为foo.rkt的文件,如下所示:

Create a file called "foo.rkt" that looks like this:

(define x 1)
(define y 2)

然后在另一个文件中:

#lang racket
(require racket/include)
(include "foo.rkt")
(+ x y)

你应该看到结果 3

您可以查看 还包括

You can see the documentation for include as well.

这篇关于在球拍中包含外部文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆