Subject: bug#17502: closed (Re: bug#17502: R6RS `library' form must have exports before imports)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 06 Jun 2014 20:41:03 +0000

Your bug report

#17502: R6RS `library' form must have exports before imports

which was filed against the guile package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
17502: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17502
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#17502: R6RS `library' form must have exports before imports
From: Mark H Weaver <[email-masked]>
To: Taylan Ulrich Bayirli/Kammer <[email-masked]>
Cc: [email-masked]
Date: Fri, 06 Jun 2014 16:39:08 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Taylan Ulrich Bayirli/Kammer <[email-masked]> writes:
> Here the improved patch, against stable-2.0/73ff8e3:

Pushed, thanks!

     Mark

Subject: R6RS `library' form must have exports before imports
From: Taylan Ulrich Bayirli/Kammer <[email-masked]>
To: [email-masked]
Date: Thu, 15 May 2014 23:02:25 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

The R6RS `library' form requires the (export ...) list to appear
before the (import ...) list.  I'm not sure if this itself is a bug;
R6RS consistently uses that order, doesn't mention the order to be
irrelevant, and seems to me to imply that it's indeed mandatory.  I
didn't check for what other R6RS implementations do though.

Here's a corresponding documentation patch against master/3be43fb:

>From 7900da779f1ab267481ad1a08a0547083936d11f Mon Sep 17 00:00:00 2001
From: Taylan Ulrich B <[email-masked]>
Date: Thu, 15 May 2014 22:55:40 +0200
Subject: [PATCH] R6RS library documentation fix

* doc/ref/api-modules.texi: In the R6RS `library' form, exports must
  appear before imports.
---
 doc/ref/api-modules.texi | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/doc/ref/api-modules.texi b/doc/ref/api-modules.texi
index 286a37d..47171c6 100644
--- a/doc/ref/api-modules.texi
+++ b/doc/ref/api-modules.texi
@@ -584,8 +584,8 @@ expression:
 
 @lisp
   (library (mylib (1 2))
-    (import (otherlib (3)))
-    (export mybinding))
+    (export mybinding)
+    (import (otherlib (3))))
 @end lisp
 
 is equivalent to the module definition:
@@ -597,6 +597,8 @@ is equivalent to the module definition:
     #:export (mybinding))
 @end lisp
 
+Note that exports must appear before imports in the `library' form.
+
 Central to the mechanics of R6RS libraries is the concept of import
 and export @dfn{levels}, which control the visibility of bindings at
 various phases of a library's lifecycle --- macros necessary to 
-- 
1.8.4