unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Problem testing cond-expand syntax from (scheme base) in pure module
@ 2023-11-27 20:50 Maxim Cournoyer
  0 siblings, 0 replies; only message in thread
From: Maxim Cournoyer @ 2023-11-27 20:50 UTC (permalink / raw)
  To: guile-devel

Hello,

I'm trying to test cond-expand as provided by (scheme base), which is
the R7RS flavored version of cond-expand, but it fails when in a pure
Guile module:

--8<---------------cut here---------------start------------->8---
new file   test-suite/tests/r7rs-cond-expand.test
@@ -0,0 +1,19 @@
+(define-module (test-suite r7rs-cond-expand)
+  #:pure
+  #:use-module (scheme base)
+  #:use-module ((srfi srfi-64) #:select (test-read-eval-string))
+  #:use-module (test-suite lib))
+
+(pass-if "cond-expand expression missing library test"
+  (test-read-eval-string "\
+(cond-expand
+ ((library (srfi srfi-99999))
+  #f)
+ (else #t))"))
+
+(pass-if "cond-expand expression found library test"
+  (test-read-eval-string "\
+(cond-expand
+ ((library (srfi srfi-64))
+  #t)
+ (else #f))"))

# Running it:
./meta/guile -L test-suite -L . test-suite/tests/r7rs-cond-expand.test
ERROR: cond-expand expression missing library test - arguments: ((syntax-error #f "source expression failed to match any pattern" ((line . 1) (column . 2)) (library (srfi srfi-99999)) #f))
ERROR: cond-expand expression found library test - arguments: ((syntax-error #f "source expression failed to match any pattern" ((line . 1) (column . 2)) (library (srfi srfi-64)) #f))
--8<---------------cut here---------------end--------------->8---

Would someone have a clue as to why?

If I drop #:pure, it then works as expected.  Is this a bug?

-- 
Thanks,
Maxim



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-27 20:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-27 20:50 Problem testing cond-expand syntax from (scheme base) in pure module Maxim Cournoyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).