GNU bug report logs - #10246
R6RS library form broken?

Previous Next

Package: guile;

Reported by: Tobias Brandt <tob.brandt <at> googlemail.com>

Date: Wed, 7 Dec 2011 18:08:01 UTC

Severity: normal

Done: Andy Wingo <wingo <at> pobox.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10246 in the body.
You can then email your comments to 10246 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#10246; Package guile. (Wed, 07 Dec 2011 18:08:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tobias Brandt <tob.brandt <at> googlemail.com>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Wed, 07 Dec 2011 18:08:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tobias Brandt <tob.brandt <at> googlemail.com>
To: bug-guile <at> gnu.org
Subject: R6RS library form broken?
Date: Wed, 7 Dec 2011 18:53:59 +0100
Hi,

I'm running the latest git version (2.0.3.244-04ec29).
Declaring a R6RS style library doesn't work:

(library (foo))

=>
ice-9/psyntax.scm:1422:30: In procedure expand-macro:
ice-9/psyntax.scm:1422:30: Syntax error:
source expression failed to match any pattern in form (library (foo))


while this does:

(define-module (foo))




Information forwarded to bug-guile <at> gnu.org:
bug#10246; Package guile. (Wed, 07 Dec 2011 23:06:01 GMT) Full text and rfc822 format available.

Message #8 received at 10246 <at> debbugs.gnu.org (full text, mbox):

From: Ian Price <ianprice90 <at> googlemail.com>
To: Tobias Brandt <tob.brandt <at> googlemail.com>
Cc: 10246 <at> debbugs.gnu.org
Subject: Re: bug#10246: R6RS library form broken?
Date: Wed, 07 Dec 2011 23:00:59 +0000
Tobias Brandt <tob.brandt <at> googlemail.com> writes:

> Declaring a R6RS style library doesn't work:
>
> (library (foo))
>
> =>
> ice-9/psyntax.scm:1422:30: In procedure expand-macro:
> ice-9/psyntax.scm:1422:30: Syntax error:
> source expression failed to match any pattern in form (library (foo))
>
>
> while this does:
>
> (define-module (foo))

This is a misunderstanding on your part, I'm afraid. R6RS library forms
are intended to wrap the code[0]; they are not declarations to be placed at
the top. The manual does mention this[1], by noting the syntax for library
is

(library name (export export-spec ...) (import import-spec ...) body ...)

Without an example, I can see how the equivalence mentioned at the top
may be misleading. Perhaps the manual should add an example? Even
something as simple as, say

(library (counters)
(export make-counter)
(import (rnrs base)

(define (make-counter start)
  (lambda ()
    (let ((val start))
      (set! start (+ start 1))
      val)))

)

would probably be helpful.

0. http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-10.html
1. http://www.gnu.org/software/guile/manual/html_node/R6RS-Libraries.html

-- 
Ian Price

"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"




Reply sent to Andy Wingo <wingo <at> pobox.com>:
You have taken responsibility. (Thu, 08 Dec 2011 20:07:01 GMT) Full text and rfc822 format available.

Notification sent to Tobias Brandt <tob.brandt <at> googlemail.com>:
bug acknowledged by developer. (Thu, 08 Dec 2011 20:07:02 GMT) Full text and rfc822 format available.

Message #13 received at 10246-done <at> debbugs.gnu.org (full text, mbox):

From: Andy Wingo <wingo <at> pobox.com>
To: Ian Price <ianprice90 <at> googlemail.com>
Cc: Tobias Brandt <tob.brandt <at> googlemail.com>, 10246-done <at> debbugs.gnu.org
Subject: Re: bug#10246: R6RS library form broken?
Date: Thu, 08 Dec 2011 21:05:34 +0100
On Thu 08 Dec 2011 00:00, Ian Price <ianprice90 <at> googlemail.com> writes:

> Tobias Brandt <tob.brandt <at> googlemail.com> writes:
>
>> (library (foo))
>
> This is a misunderstanding on your part, I'm afraid. R6RS library forms
> are intended to wrap the code[0]; they are not declarations to be placed at
> the top. The manual does mention this[1], by noting the syntax for library
> is
>
> (library name (export export-spec ...) (import import-spec ...) body ...)

Indeed.  Thanks for the answer, Ian.

In the new email-happy bug system, to close a bug you edit the Cc: list
to add -done after the bug number, as I have done here.  Feel free to do
this for any bug that you feel is done; if we make a mistake, we can
simply re-open it.

I'm sure we could do better accounting as to the kind of resolution and
such, but I'm most concern with simply marking bugs as being resolved.

Regards, and happy hacking to you both :-)

Andy
-- 
http://wingolog.org/




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 06 Jan 2012 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 224 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.