More r6rs/guile Felix Thibault (27 Sep 2020 16:35 UTC)
Re: More r6rs/guile Lassi Kortela (27 Sep 2020 16:39 UTC)
Re: More r6rs/guile Felix Thibault (27 Sep 2020 16:53 UTC)
Re: More r6rs/guile Marc Nieper-Wißkirchen (27 Sep 2020 17:17 UTC)
R7RS conformance Lassi Kortela (27 Sep 2020 17:53 UTC)
Re: R7RS conformance Marc Nieper-Wißkirchen (27 Sep 2020 18:12 UTC)
Re: R7RS conformance John Cowan (27 Sep 2020 18:47 UTC)
Re: R7RS conformance Marc Nieper-Wißkirchen (27 Sep 2020 19:18 UTC)
Re: R7RS conformance John Cowan (27 Sep 2020 19:33 UTC)
Re: R7RS conformance Lassi Kortela (27 Sep 2020 19:47 UTC)
Re: R7RS conformance Marc Nieper-Wißkirchen (27 Sep 2020 19:53 UTC)
Re: R7RS conformance Lassi Kortela (27 Sep 2020 19:54 UTC)
Re: More r6rs/guile John Cowan (27 Sep 2020 19:32 UTC)
Re: More r6rs/guile Marc Nieper-Wißkirchen (27 Sep 2020 19:57 UTC)
Re: More r6rs/guile Felix Thibault (27 Sep 2020 22:30 UTC)

Re: More r6rs/guile Marc Nieper-Wißkirchen 27 Sep 2020 19:57 UTC

Am So., 27. Sept. 2020 um 21:32 Uhr schrieb John Cowan <xxxxxx@ccil.org>:
>
> 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 ...)))])))

The power of procedural macros! :)

PS The only drawback with this approach is that all source code
location information is lost, which can make debugging hard.