The include form does not work, because when the language is set to "Beginning Student" or one of the other teaching languages, DrRacket actually wraps your program in a module. You can see this if you open "test.rkt" in a regular text editor. The bit #reader.... is what the module generates. But when it gets included in another file, it makes no sense. Thus, the error causing complaints about module .
Unfortunately, as far as I can tell, in the HtDP languages ββthere is still no provide what you need to work properly.
If you really want this to work, here is a way to hack it:
Create a new file called "provide.rkt" in the same directory as your other files. While you are editing this file (and only this file), set the language in DrRacket to "Detect language from source". Put the following two lines in "provide.rkt" :
(Declares a module using the full Racket language, which provides only the built-in special form provide .)
Add the following lines to your "test.rkt" program. (Make sure that DrRacket Language is set to "Beginning Student" or what training language you use for this.)
(require "provide.rkt") (provide test)
Now "test.rkt" is the module that exports your test function. (It was always a module, it just didnβt have an export before, so it wasnβt very useful.)
Add the following lines to your "newtest.rkt" program:
(require "test.rkt")
This imports everything that is provided by "test.rkt" : it is currently just a test , but you can add other things, you just need to provide them.
source share