Skip to content

Encouraged behavior for include #546

Description

@Retropikzel

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions