What is that include relative to?
Right now I'm having the issue where I had this directory structure:
srfi--------auxiliary-syntax.scm
         |
         |---204/204.scm
         |---chez9.5/match.sls
         |---loko0.5/match.sls
         test/
              |
              |---chez-match-test.scm
              |---loko-match-test.scm 

and when I factored out the test directory so it was at the same level as srfi/, 
the includes inside the match.sls files stopped working even though none
of those files had moved relative to each other.


On Sun, Sep 27, 2020 at 3:32 PM John Cowan <xxxxxx@ccil.org> wrote:
I agree that r6rs libraries are the Right Thing for Guile, and neither native modules nor R7RS libraries.  There is no distinction between include and include-library-declarations in R6RS, as all that is allowed is a single export and a single import (with any number of libraries, of course) and the rest is code.

If an R6RS doesn't have `include`, it is trivial to package this definition (from R6RS Libraries 12.6 s.v. datum->syntax) in an (include) library:

(define-syntax include
  (lambda (x)
    (define read-file
      (lambda (fn k)
        (let ([p (open-file-input-port fn)])
          (let f ([x (get-datum p)])
            (if (eof-object? x)
                (begin (close-port p) '())
                (cons (datum->syntax k x)
                      (f (get-datum p))))))))
    (syntax-case x ()
      [(k filename)
       (let ([fn (syntax->datum #'filename)])
         (with-syntax ([(exp ...)
                        (read-file fn #'k)])
           #'(begin exp ...)))])))



John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
Man has no body distinct from his soul, for that called body is a portion
of the soul discerned by the five senses, the chief inlets of the soul
in this age.  --William Blake