bug#52239: R7RS define-library does not support cond-expand

2023-11-09 Thread Maxim Cournoyer
Hi,

Amirouche  writes:

> fixed in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40252

Great!  Closing, by replying to '52239-d...@debbugs.gnu.org'.

-- 
Thanks,
Maxim





bug#52239: R7RS define-library does not support cond-expand

2021-12-02 Thread Amirouche
workaround:

#;> find live -type f -exec sh -c "echo \";;; cat {}\"; cat {}" \;
;;; cat live/hello/body.scm
(define (hello name)
  (display "Hello schemer ")
  (display name)
  (display "!")
  (newline))
;;; cat live/hello.scm
(define-library (live hello)
  (import (scheme base)
  (scheme write))
  (export hello)

  (include "hello/body.scm"))
;;; cat live/hello.sld
(define-library (live hello)
  (import (scheme base)
  (scheme write))
  (export hello)
  (cond-expand
   ((or mit guile chibi gambit gerbil loko)
(include "hello/body.scm"))
   ;; That is the rule picked up by chicken
   (else (include "live/hello/body.scm"
;;; cat live/hello.rkt
#!r7rs
(define-library (live hello)
  (export hello)

  (import (scheme base)
  (scheme write))

  (include "hello/body.scm"))
;;; cat live/hello.chez.sls
(library (live hello)
  (export hello)
  (import (chezscheme))

  (include "hello/body.scm"))
#;>

The following command

  guile myprogram.scm

will pick `live/hello.scm` as the library `(live hello)`

Unlike:

  guile --r7rs myprogram.scm

that will pick `live/hello.sld` that contains a cond-expand, and that is not 
supported  by guile.