I have the following directory structure (minimal demo):
main.scm
(load "regex_utils.scm")
(displayln "test")
...
regex_utils.scm
(load "utils.scm")
... ; load many other lib files
utils.scm
(define (displayln x)
(newline)
(display x))
But when running scheme < main.scm
it will throw error “;Unbound variable: displayln”. How to make displayln
available in regex_utils.scm also available in main.scm?
It seems to be related with environment which is used in MIT 6.5151 code base. But I don’t know how to make 2 files sharing one environment since the-environment
can be only called in a top-level environment. (I only read Software Design for Flexibility up to section 2.2, so this paragraph may have some errors.)