unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: guile-devel <guile-devel@gnu.org>
Subject: Problem testing cond-expand syntax from (scheme base) in pure module
Date: Mon, 27 Nov 2023 15:50:11 -0500	[thread overview]
Message-ID: <87o7fe6hvg.fsf@gmail.com> (raw)

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



                 reply	other threads:[~2023-11-27 20:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o7fe6hvg.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).