justinethier / cyclone

:cyclone: A brand-new compiler that allows practical application development using R7RS Scheme. We provide modern features and a stable system capable of generating fast native binaries.
http://justinethier.github.io/cyclone/
MIT License
825 stars 44 forks source link

Problems with library includes #405

Closed justinethier closed 4 years ago

justinethier commented 4 years ago

Attempting to use the schemepunk library with the following test file:

(import (scheme base)
        (schemepunk syntax))

(write-string (chain "Hello" (string-append _ ", World!" "\n")))

However, compilation raises the following error:

[justin@justin-pc schemepunk]$ cyclone hello.scm
Error: Identifier is exported but not defined:
chain

Error: Unbound variable(s):
(_)

It looks like there is a problem compiling syntax.sld. The schemepunk author pointed out the include on line 195. The issue seems to be that the include is being expanded with a lambda instead of directly within the begin:

   (begin
     ((lambda ()
        (define syntax-symbol-case
justinethier commented 4 years ago

This has been fixed, and a separate issue opened for schemepunk.