unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#17502: R6RS `library' form must have exports before imports
@ 2014-05-15 21:02 Taylan Ulrich Bayirli/Kammer
  2014-05-16  3:12 ` dsmich
  2014-06-05  1:24 ` Mark H Weaver
  0 siblings, 2 replies; 5+ messages in thread
From: Taylan Ulrich Bayirli/Kammer @ 2014-05-15 21:02 UTC (permalink / raw)
  To: 17502

[-- Attachment #1: Type: text/plain, Size: 398 bytes --]

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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-R6RS-library-documentation-fix.patch --]
[-- Type: text/x-diff, Size: 1164 bytes --]

From 7900da779f1ab267481ad1a08a0547083936d11f Mon Sep 17 00:00:00 2001
From: Taylan Ulrich B <taylanbayirli@gmail.com>
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


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

* bug#17502: R6RS `library' form must have exports before imports
  2014-05-15 21:02 bug#17502: R6RS `library' form must have exports before imports Taylan Ulrich Bayirli/Kammer
@ 2014-05-16  3:12 ` dsmich
  2014-06-05  1:24 ` Mark H Weaver
  1 sibling, 0 replies; 5+ messages in thread
From: dsmich @ 2014-05-16  3:12 UTC (permalink / raw)
  To: 17502, Taylan Ulrich Bayirli/Kammer


---- Taylan Ulrich Bayirli/Kammer <taylanbayirli@gmail.com> wrote: 
> 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.

From http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-10.html#node_sec_7.1 :

A library definition must have the following form:

(library <library name>
  (export <export spec> ...)

  (import <import spec> ...)

  <library body>)

Seems unambiguous to me.

-Dale






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

* bug#17502: R6RS `library' form must have exports before imports
  2014-05-15 21:02 bug#17502: R6RS `library' form must have exports before imports Taylan Ulrich Bayirli/Kammer
  2014-05-16  3:12 ` dsmich
@ 2014-06-05  1:24 ` Mark H Weaver
  2014-06-05 17:31   ` Taylan Ulrich Bayirli/Kammer
  1 sibling, 1 reply; 5+ messages in thread
From: Mark H Weaver @ 2014-06-05  1:24 UTC (permalink / raw)
  To: Taylan Ulrich Bayirli/Kammer; +Cc: 17502

Taylan Ulrich Bayirli/Kammer <taylanbayirli@gmail.com> writes:

> The R6RS `library' form requires the (export ...) list to appear
> before the (import ...) list.

Indeed, good catch!

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

We will want to apply this to stable-2.0.

> From 7900da779f1ab267481ad1a08a0547083936d11f Mon Sep 17 00:00:00 2001
> From: Taylan Ulrich B <taylanbayirli@gmail.com>
> 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.

The changelog should briefly describe the changes made.  Also, when
making changes to texi files, our convention is to include the node name
in parentheses before the colon.  So maybe something like this:

* doc/ref/api-modules.texi (R6RS Libraries): Move 'export' before
  'import' in the example library form, as required by the R6RS.

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

I don't think we need to mention this.  IMO the R6RS is quite clear, as
Dale pointed out.

    Thanks!
      Mark





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

* bug#17502: R6RS `library' form must have exports before imports
  2014-06-05  1:24 ` Mark H Weaver
@ 2014-06-05 17:31   ` Taylan Ulrich Bayirli/Kammer
  2014-06-06 20:39     ` Mark H Weaver
  0 siblings, 1 reply; 5+ messages in thread
From: Taylan Ulrich Bayirli/Kammer @ 2014-06-05 17:31 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: 17502

[-- Attachment #1: Type: text/plain, Size: 93 bytes --]

Hi Mark, thanks for the comments. :-)

Here the improved patch, against stable-2.0/73ff8e3:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: R6RS library documentation patch --]
[-- Type: text/x-diff, Size: 818 bytes --]

From 73ff8e3d19430f305a44cce839a588f68a0704d1 Mon Sep 17 00:00:00 2001
From: Taylan Ulrich B <taylanbayirli@gmail.com>
Date: Thu, 5 Jun 2014 19:27:53 +0200
Subject: [PATCH] R6RS library documentation fix

* doc/ref/api-modules.texi (R6RS Libraries): Move 'export' before
  'import' in the example library form, as required by R6RS.
---
 doc/ref/api-modules.texi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/ref/api-modules.texi b/doc/ref/api-modules.texi
index 286a37d..0f54e01 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:
-- 
1.8.4


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

* bug#17502: R6RS `library' form must have exports before imports
  2014-06-05 17:31   ` Taylan Ulrich Bayirli/Kammer
@ 2014-06-06 20:39     ` Mark H Weaver
  0 siblings, 0 replies; 5+ messages in thread
From: Mark H Weaver @ 2014-06-06 20:39 UTC (permalink / raw)
  To: Taylan Ulrich Bayirli/Kammer; +Cc: 17502-done

Taylan Ulrich Bayirli/Kammer <taylanbayirli@gmail.com> writes:
> Here the improved patch, against stable-2.0/73ff8e3:

Pushed, thanks!

     Mark





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

end of thread, other threads:[~2014-06-06 20:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-15 21:02 bug#17502: R6RS `library' form must have exports before imports Taylan Ulrich Bayirli/Kammer
2014-05-16  3:12 ` dsmich
2014-06-05  1:24 ` Mark H Weaver
2014-06-05 17:31   ` Taylan Ulrich Bayirli/Kammer
2014-06-06 20:39     ` Mark H Weaver

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