bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Amirouche
Subject: bug#52239: R7RS define-library does not support cond-expand
Date: Thu, 02 Dec 2021 09:15:04 +0000

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]