0

I've been trying to load another file into my Scheme scrip but when I do this,

(load "fn1.lisp")

the error came out as

The port #[input-port 13 for file: "/Users/yiwenzhu/Library/Mobile Documents/com~apple~CloudDocs/work/study/computer/SICP/src_lisp/fn1.lisp"] signalled an error:
The primitive channel-read, while executing the read system call, received the error: Bad address.

How to solve this? Thanks.

1 Answers1

1

load is the only compatible way until R5RS, but after that the standard introduced libraries. Where the files need to be installed is implementation dependent, but the source structure on how to define and use isn't.

Also know that SICP is pre-R5RS so there isn't one modern Scheme implementation that would run the books examples without some compatibility layer. Eg. I have an answer about how to do SICP with DrRacket.

Since we don't know how the file you are trying to include look like or which Scheme implementation you are using I'm afraid I cannot help you further. I can update if you update your question.

Sylwester
  • 47,942
  • 4
  • 47
  • 79
  • Thanks for your incredible answer, in this case, I've decided not to use load for a while, and if there's any new compatibility issue come up I will look into the usage of DrRacket, helps a lot, really appreciate it. – chisei minamoto Jan 02 '22 at 23:50