sicp-lang / sicp

A SICP language for Racket.
GNU Lesser General Public License v3.0
191 stars 24 forks source link

Any way to include other files? #50

Closed drcxd closed 1 week ago

drcxd commented 1 week ago

In Chez Scheme, I can use (load "./xyz.scm") to include definitions of functions in xyz.scm to the current file and use these function in the current file.

I have seen that racket support require, import and load. However, when using #lang sicp, it seems that require and import are both undefined. load is defined, but (load "./xyz.rkt") can not bring definitions of functions in "xyz.rkt" into the scope of the current file. Can I achieve the same effect of load in Chez Scheme in SICP language?

drcxd commented 1 week ago

Learned to use "#%require" and "#%provide" from the documentation which I had no access to previously.