Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encouraged behavior for include #546

Open
Retropikzel opened this issue Oct 4, 2024 · 0 comments
Open

Encouraged behavior for include #546

Retropikzel opened this issue Oct 4, 2024 · 0 comments

Comments

@Retropikzel
Copy link

Retropikzel commented Oct 4, 2024

Currently if you have this directory structure:

bar/baz.sld:

(define-library
  (bar baz)
  (import (scheme base)
          (scheme write))
  (export hello)
  (begin
    (include "baz.scm")))

bar/baz.scm:

(define hello
  (lambda ()
    (display "Hello")
    (newline)))

And you try to compile it with Cyclone with:

cyclone bar/baz.sld

You get:

Error at line 7, column 5 of bar/baz.sld: Unable to open file: 
"baz.scm"

The R7RS 4.1.7 Inclusion has note:
Note: Implementations are encouraged to search for files in
the directory which contains the including file, and to provide
a way for users to specify other directories to search.

Would it be possible to search for included files in the same directory the including file is in?

In the situation where the library amount grows, say to even 5 libraries telling the implementation (for example with a flag) where to include files from is not as ideal. But it would be better than nothing. Or maybe even both could be added?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant