unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#10246: R6RS library form broken?
@ 2011-12-07 17:53 Tobias Brandt
  2011-12-07 23:00 ` Ian Price
  0 siblings, 1 reply; 3+ messages in thread
From: Tobias Brandt @ 2011-12-07 17:53 UTC (permalink / raw)
  To: 10246

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))





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#10246: R6RS library form broken?
  2011-12-07 17:53 bug#10246: R6RS library form broken? Tobias Brandt
@ 2011-12-07 23:00 ` Ian Price
  2011-12-08 20:05   ` Andy Wingo
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Price @ 2011-12-07 23:00 UTC (permalink / raw)
  To: Tobias Brandt; +Cc: 10246

Tobias Brandt <tob.brandt@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"





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#10246: R6RS library form broken?
  2011-12-07 23:00 ` Ian Price
@ 2011-12-08 20:05   ` Andy Wingo
  0 siblings, 0 replies; 3+ messages in thread
From: Andy Wingo @ 2011-12-08 20:05 UTC (permalink / raw)
  To: Ian Price; +Cc: 10246-done

On Thu 08 Dec 2011 00:00, Ian Price <ianprice90@googlemail.com> writes:

> Tobias Brandt <tob.brandt@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/





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-08 20:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-07 17:53 bug#10246: R6RS library form broken? Tobias Brandt
2011-12-07 23:00 ` Ian Price
2011-12-08 20:05   ` Andy Wingo

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).