Realm of Racket, chapter 2

Hello.
In order to make a better version of the Program "Guess my number", I have begun to splitt the program into two parts, as you see here:

As you see, I have to define someway the "variables" variable. Is this the only way to link the two parts of the program or do you have a second, more elegant way to do that? Otherwise Dr Racket complains that "variables" is not defined.. I mean, is there a way to use open and close so that the compiler understands that under "variables" I mean "upper" AND "lower"?

Delete (provide variables).
Delete (define variables null).

There’s no need for these lines.

1 Like

I am not 100% sure what you are looking for, but you can write:

(provide lower upper)

Or if you don't want to explicitly list all identifiers:

(provide (all-defined-out))

The downside of all-defined-out is that all functions and variables are exported,
also variables and functions only relevant to the module.

1 Like