unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: 67412@debbugs.gnu.org
Subject: bug#67412: (resolve-r6rs-interface '(srfi 160 u8) tries to load (srfi srfi-160)
Date: Thu, 23 Nov 2023 16:44:54 -0500	[thread overview]
Message-ID: <87il5s6t61.fsf@gmail.com> (raw)
In-Reply-To: <87o7fk6yp8.fsf@gmail.com> (Maxim Cournoyer's message of "Thu, 23 Nov 2023 14:45:23 -0500")

Hi,

Investigating, I've found this:

--8<---------------cut here---------------start------------->8---
trace: |  (_ #<procedure 7fc0c55af068 at ice-9/r6rs-libraries.scm:104:5 (n rest version)> (160 (u8) ()))
trace: |  (_ 160 (u8) ())
trace: |  |  (syntax->datum 160)
trace: |  |  (strip 160)
trace: |  |  |  (syntax? 160)
trace: |  |  |  #f
trace: |  |  160
trace: |  |  (number->string 160)
trace: |  |  "160"
trace: |  |  (string-append "srfi-" "160")
trace: |  |  "srfi-160"
trace: |  |  (datum->syntax #<syntax:r6rs-libraries.scm:92:34 srfi> srfi-160)
trace: |  |  |  (syntax-wrap #<syntax:r6rs-libraries.scm:92:34 srfi>)
trace: |  |  |  ((top) #(ribcage #(n rest version) #((top) (top) (top)) #("l-680b775fb37a463-160b" "l-680b775fb37a463-160c" "l-680b775fb37a463-160d")) #(ribcage (module-for-each/nonlocal # make-srfi-n # …) …) …)
trace: |  |  |  (syntax-module #<syntax:r6rs-libraries.scm:92:34 srfi>)
trace: |  |  |  (hygiene guile)
trace: |  |  |  (source-properties srfi-160)
trace: |  |  |  ()
trace: |  |  (make-syntax srfi-160 ((top) #(ribcage #(n rest version) #((top) (top) (top)) #("l-680b775fb37a463-160b" "l-680b775fb37a463-160c" "l-680b775fb37a463-160d")) #(ribcage (# # make-srfi-n # # …) …) …) …)
trace: |  |  #<syntax srfi-160>
trace: |  |  ($sc-dispatch (u8) ())
trace: |  |  |  (syntax? (u8))
trace: |  |  |  #f
trace: |  |  (match* (u8) () (()) () #f)
trace: |  |  #f
trace: |  |  ($sc-dispatch (u8) (any . each-any))
trace: |  |  |  (syntax? (u8))
trace: |  |  |  #f
trace: |  |  (match* (u8) (any . each-any) (()) () #f)
trace: |  |  |  (match () each-any (()) () #f)
trace: |  |  |  |  (syntax? ())
trace: |  |  |  |  #f
trace: |  |  |  (match* () each-any (()) () #f)
trace: |  |  |  |  (match-each-any () (()) #f)
trace: |  |  |  |  ()
trace: |  |  |  (())
trace: |  |  (match u8 any (()) (()) #f)
trace: |  |  |  (source-wrap u8 (()) #f #f)
trace: |  |  |  u8
trace: |  |  (u8 ())
trace: |  |  (_ #<procedure 7fc0c108e1e0 at ice-9/r6rs-libraries.scm:93:7 (name rest)> (u8 ()))
trace: |  |  (_ u8 ())
trace: |  |  |  (append () (()))
trace: |  |  |  (())
--8<---------------cut here---------------end--------------->8---

This corresponds to this source:

--8<---------------cut here---------------start------------->8---
 (syntax-case import-spec (library only except prefix rename srfi)
    ;; (srfi :n ...) -> (srfi srfi-n ...)
    ;; (srfi n ...) -> (srfi srfi-n ...)
    ((library (srfi n rest ... (version ...)))
     (srfi-name? #'(srfi n rest ...))
     (let ((srfi-n (make-srfi-n #'srfi #'n)))
       (resolve-r6rs-interface
        (syntax-case #'(rest ...) ()
          (()
           #`(library (srfi #,srfi-n (version ...))))
          ((name rest ...)
           ;; SRFI 97 says that the first identifier after the `n'
           ;; is used for the libraries name, so it must be ignored.
           #`(library (srfi #,srfi-n rest ... (version ...))))))))
    ...
--8<---------------cut here---------------end--------------->8---

Notice the comment mentioning that the first identifier following 'n' is
ignored.  That seems wrong, at least in the context of R7RS libraries.

-- 
Thanks,
Maxim





  reply	other threads:[~2023-11-23 21:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-23 19:45 bug#67412: (resolve-r6rs-interface '(srfi 160 u8) tries to load (srfi srfi-160) Maxim Cournoyer
2023-11-23 21:44 ` Maxim Cournoyer [this message]
2023-11-24 16:39 ` bug#67412: [PATCH 1/2] Use R7RS 'rename' syntax for exports Maxim Cournoyer
2023-11-24 16:39   ` bug#67412: [PATCH 2/2] r7rs-libraries: Better support R7RS SRFI library names Maxim Cournoyer
2023-11-24 21:19 ` bug#67412: [PATCH v2 1/2] Use R7RS 'rename' syntax for exports Maxim Cournoyer
2023-11-24 21:19   ` bug#67412: [PATCH v2 2/2] r7rs-libraries: Better support R7RS SRFI library names Maxim Cournoyer

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=87il5s6t61.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=67412@debbugs.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).