(define bootstrap-c-code
(define (from-file file-name)
(let* ((ip (open-input-file file-name))
(res (read-text-file-from-input-port ip)))
(close-input-port ip)
res))
(from-file "llvm.c"))
Error : define: bad syntax (multiple expressions after identifier)
But I can’t see anything wrong with it. Can someone explain / fix it please.
It’s not clear what you intended with the above code. If you were trying to load a text file and leave the loaded value in a variable called
bootstrap-c-code, then try this:Of course, the
from-filedefinition will only be visible inside thelet, if you need to use it outside,defineit outside of the whole expression. If you only need the functionality offrom-fileinside thelet, you can obtain the same result in a much simpler way:On the other hand, if what you intended was to create a procedure called
bootstrap-c-code, then the correct syntax would be: