unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* rfc (define-module ... #:use-modules ...)
@ 2007-10-04 14:10 Thien-Thi Nguyen
  2007-10-04 15:29 ` Ludovic Courtès
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Thien-Thi Nguyen @ 2007-10-04 14:10 UTC (permalink / raw)
  To: guile-user

currently:
  (define-module (foo)
    #:use-module (a b c)
    #:use-module ((d e f) #:select (x y z))
    #:export (bar))

proposed:
  (define-module (foo)
    #:use-modules
    (a b c)
    ((d e f) #:select (x y z))
    #:export (bar))

that is, `#:use-modules X Y Z' would be exactly equivalent
to `#:use-module X #:use-module Y #:use-module Z'.

quantitatively, for N upstream (used) modules, this would result
in N-1 fewer keywords required in the `define-module' form.

what do people think of this syntatic sugar?  (i was about to add it
to guile 1.4.x, but thought perhaps if official guile maintainers
have different ideas i should wait so as to be able to harmonize w/
their design (assuming the feature merits attention).  perhaps we can
start to build towards each other in this way.)

thi


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: rfc (define-module ... #:use-modules ...)
  2007-10-04 14:10 rfc (define-module ... #:use-modules ...) Thien-Thi Nguyen
@ 2007-10-04 15:29 ` Ludovic Courtès
  2007-10-04 18:40   ` Thien-Thi Nguyen
  2007-10-04 15:30 ` Mike Gran
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 17+ messages in thread
From: Ludovic Courtès @ 2007-10-04 15:29 UTC (permalink / raw)
  To: guile-user

Hi,

Thien-Thi Nguyen <ttn@gnuvola.org> writes:

> currently:
>   (define-module (foo)
>     #:use-module (a b c)
>     #:use-module ((d e f) #:select (x y z))
>     #:export (bar))
>
> proposed:
>   (define-module (foo)
>     #:use-modules
>     (a b c)
>     ((d e f) #:select (x y z))
>     #:export (bar))
>
> that is, `#:use-modules X Y Z' would be exactly equivalent
> to `#:use-module X #:use-module Y #:use-module Z'.

Why not, but (i) Emacs would have a hard time indenting this ;-), and
(ii) given that it provides little benefits, I think I'd be more
inclined to not change anything.

My two cents...

Ludovic.



_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: rfc (define-module ... #:use-modules ...)
  2007-10-04 14:10 rfc (define-module ... #:use-modules ...) Thien-Thi Nguyen
  2007-10-04 15:29 ` Ludovic Courtès
@ 2007-10-04 15:30 ` Mike Gran
  2007-10-04 16:29   ` Ludovic Courtès
  2007-10-04 19:12   ` Thien-Thi Nguyen
  2007-10-04 17:14 ` Clinton Ebadi
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 17+ messages in thread
From: Mike Gran @ 2007-10-04 15:30 UTC (permalink / raw)
  To: guile-user

--- Thien-Thi Nguyen <ttn@gnuvola.org> wrote:

> proposed:
>   (define-module (foo)
>     #:use-modules
>     (a b c)
>     ((d e f) #:select (x y z))
>     #:export (bar))
> 
> that is, `#:use-modules X Y Z' would be exactly equivalent
> to `#:use-module X #:use-module Y #:use-module Z'.
> 

I like it for two reasons.

1. The lack of parallelism between the (use-modules) procedure and the
#:use-module form has always bothered me.

2. It would then be a bit easier to create a mapping to the r6rs
library form.  In r6rs libraries, you can include multiple libraries
with one "import" command.



_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: rfc (define-module ... #:use-modules ...)
  2007-10-04 15:30 ` Mike Gran
@ 2007-10-04 16:29   ` Ludovic Courtès
  2007-10-04 19:12   ` Thien-Thi Nguyen
  1 sibling, 0 replies; 17+ messages in thread
From: Ludovic Courtès @ 2007-10-04 16:29 UTC (permalink / raw)
  To: guile-user

Hi,

Mike Gran <spk121@yahoo.com> writes:

> 2. It would then be a bit easier to create a mapping to the r6rs
> library form.  In r6rs libraries, you can include multiple libraries
> with one "import" command.

IMO, this argument doesn't count because that would *definitely* not be
the hardest part in implementing R6RS libraries.  :-)

Thanks,
Ludovic.



_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: rfc (define-module ... #:use-modules ...)
  2007-10-04 14:10 rfc (define-module ... #:use-modules ...) Thien-Thi Nguyen
  2007-10-04 15:29 ` Ludovic Courtès
  2007-10-04 15:30 ` Mike Gran
@ 2007-10-04 17:14 ` Clinton Ebadi
  2007-10-04 19:09   ` Thien-Thi Nguyen
  2007-10-04 19:21   ` Klaus Schilling
  2007-10-04 19:18 ` Klaus Schilling
  2007-10-05 23:47 ` Keith Wright
  4 siblings, 2 replies; 17+ messages in thread
From: Clinton Ebadi @ 2007-10-04 17:14 UTC (permalink / raw)
  To: guile-user

Thien-Thi Nguyen <ttn@gnuvola.org> writes:

> currently:
>   (define-module (foo)
>     #:use-module (a b c)
>     #:use-module ((d e f) #:select (x y z))
>     #:export (bar))
>
> proposed:
>   (define-module (foo)
>     #:use-modules
>     (a b c)
>     ((d e f) #:select (x y z))
>     #:export (bar))
>
> that is, `#:use-modules X Y Z' would be exactly equivalent
> to `#:use-module X #:use-module Y #:use-module Z'.

I would prefer something with the syntax 

#:use-modules ((a b c) 
               ((d e f) #:select (x y z)))

Which eliminates the indentation issues and brings it more in line
with the syntax of Common Lisp's defpackage :use clause. Insert
generic comment about consistent syntax here.

-- 
"Karen loved animals. Unfortunately the cheetahs betrayed her trust,"
Libot said.


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: rfc (define-module ... #:use-modules ...)
  2007-10-04 15:29 ` Ludovic Courtès
@ 2007-10-04 18:40   ` Thien-Thi Nguyen
  0 siblings, 0 replies; 17+ messages in thread
From: Thien-Thi Nguyen @ 2007-10-04 18:40 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guile-user

() ludo@gnu.org (Ludovic Courtès)
() Thu, 04 Oct 2007 17:29:38 +0200

   (i) Emacs would have a hard time indenting this ;-)

perhaps (for now).  some emacs hacker will DTRT i'm sure.

   (ii) given that it provides little benefits, I think I'd
   be more inclined to not change anything.

fair enough.  benefits of symmetry are obviously pov-dependent.

thi


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: rfc (define-module ... #:use-modules ...)
  2007-10-04 17:14 ` Clinton Ebadi
@ 2007-10-04 19:09   ` Thien-Thi Nguyen
  2007-10-04 19:21   ` Klaus Schilling
  1 sibling, 0 replies; 17+ messages in thread
From: Thien-Thi Nguyen @ 2007-10-04 19:09 UTC (permalink / raw)
  To: Clinton Ebadi; +Cc: guile-user

() Clinton Ebadi <clinton@unknownlamer.org>
() Thu, 04 Oct 2007 13:14:22 -0400

   I would prefer something with the syntax 

   #:use-modules ((a b c) 
                  ((d e f) #:select (x y z)))

that was actually my first inclination.  i suppose this way there is
also a better congruence in the differences:

 r6rs-export  :  guile-export  ::  r6rs-import  :  guile-use-modules

 (export ...)    #:export (...)    (import ...)    #:use-modules (...)

it still differs from (use-modules ...), the top-level macro, though.

probably true sugar-rush madness would be to accomodate both styles:
recognize both `#:import (X Y Z)' and `#:use-modules X Y Z'.  hmmm.

thi


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: rfc (define-module ... #:use-modules ...)
  2007-10-04 15:30 ` Mike Gran
  2007-10-04 16:29   ` Ludovic Courtès
@ 2007-10-04 19:12   ` Thien-Thi Nguyen
  1 sibling, 0 replies; 17+ messages in thread
From: Thien-Thi Nguyen @ 2007-10-04 19:12 UTC (permalink / raw)
  To: Mike Gran; +Cc: guile-user

() Mike Gran <spk121@yahoo.com>
() Thu, 4 Oct 2007 08:30:04 -0700 (PDT)

   1. The lack of parallelism between the (use-modules)
   procedure and the #:use-module form has always bothered me.

in fact, this was one of the motivations for the proposal.
others were: typing laziness, r6rs-envy (half-haha), outreach.

thi


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: rfc (define-module ... #:use-modules ...)
  2007-10-04 14:10 rfc (define-module ... #:use-modules ...) Thien-Thi Nguyen
                   ` (2 preceding siblings ...)
  2007-10-04 17:14 ` Clinton Ebadi
@ 2007-10-04 19:18 ` Klaus Schilling
  2007-10-05 23:47 ` Keith Wright
  4 siblings, 0 replies; 17+ messages in thread
From: Klaus Schilling @ 2007-10-04 19:18 UTC (permalink / raw)
  To: ttn; +Cc: guile-user

From: Thien-Thi Nguyen <ttn@gnuvola.org>
Subject: rfc (define-module ... #:use-modules ...)
Date: Thu, 04 Oct 2007 16:10:45 +0200
> 
> what do people think of this syntatic sugar?

it's ugly and unlispish

Klaus Schilling


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: rfc (define-module ... #:use-modules ...)
  2007-10-04 17:14 ` Clinton Ebadi
  2007-10-04 19:09   ` Thien-Thi Nguyen
@ 2007-10-04 19:21   ` Klaus Schilling
  1 sibling, 0 replies; 17+ messages in thread
From: Klaus Schilling @ 2007-10-04 19:21 UTC (permalink / raw)
  To: clinton; +Cc: guile-user

From: Clinton Ebadi <clinton@unknownlamer.org>
Subject: Re: rfc (define-module ... #:use-modules ...)
Date: Thu, 04 Oct 2007 13:14:22 -0400
> 
> I would prefer something with the syntax 
> 
> #:use-modules ((a b c) 
>                ((d e f) #:select (x y z)))
> 
that's definately more like it

Klaus Schilling


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: rfc (define-module ... #:use-modules ...)
  2007-10-04 14:10 rfc (define-module ... #:use-modules ...) Thien-Thi Nguyen
                   ` (3 preceding siblings ...)
  2007-10-04 19:18 ` Klaus Schilling
@ 2007-10-05 23:47 ` Keith Wright
  2007-10-06  9:59   ` Thien-Thi Nguyen
  4 siblings, 1 reply; 17+ messages in thread
From: Keith Wright @ 2007-10-05 23:47 UTC (permalink / raw)
  To: ttn; +Cc: guile-user

> From: Thien-Thi Nguyen <ttn@gnuvola.org>
> 
> that is, `#:use-modules X Y Z' would be exactly equivalent
> to `#:use-module X #:use-module Y #:use-module Z'.
> 
> quantitatively, for N upstream (used) modules, this would result
> in N-1 fewer keywords required in the `define-module' form.
> 
> what do people think of this syntatic sugar?

Syntactic sugar is really boring.

I have never understood why there are #: keywords in
the first place.  Why don't quoted symbols and
keywords defined by macros and syntactic abstraction
totally suffice?

> ... i should wait so as to be able to harmonize w/
> [guile 8] design.  perhaps we can start to build
> towards each other in this way.

It would be heartening to read that the maintainer
of the fork wants to build toward the other branch
were it not for the cynical suspicion that that
"harmonize" is like "bi-pertisan"; it means everyone
should do it my way, even if they fundamentally
disagree with me.

If you want to harmonize, maybe both branches could
think about implementing R6RS library forms.

   -- Keith


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: rfc (define-module ... #:use-modules ...)
  2007-10-05 23:47 ` Keith Wright
@ 2007-10-06  9:59   ` Thien-Thi Nguyen
  2007-10-07  4:05     ` Keith Wright
  0 siblings, 1 reply; 17+ messages in thread
From: Thien-Thi Nguyen @ 2007-10-06  9:59 UTC (permalink / raw)
  To: Keith Wright; +Cc: guile-user

() Keith Wright <kwright@keithdiane.us>
() Fri, 5 Oct 2007 19:47:50 -0400

   It would be heartening to read that the maintainer
   of the fork wants to build toward the other branch
   were it not for the cynical suspicion that that
   "harmonize" is like "bi-pertisan"; it means everyone
   should do it my way, even if they fundamentally
   disagree with me.

for me, it means everyone interested should say what they would
(or would not) do and then if there is concensus (after some
refinement), i follow.  if there is no concensus, i muddle
through the best i can (as always).  from the sound of the
responses thus far, this is the most likely outcome.

   If you want to harmonize, maybe both branches could
   think about implementing R6RS library forms.

the library body is specified to be included in the `library'
form.  OTOH, `define-module' is a peer top-level form to the
library body.  how would you reconcile these approaches?

thi


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: rfc (define-module ... #:use-modules ...)
  2007-10-06  9:59   ` Thien-Thi Nguyen
@ 2007-10-07  4:05     ` Keith Wright
  2007-10-07  9:37       ` Thien-Thi Nguyen
  0 siblings, 1 reply; 17+ messages in thread
From: Keith Wright @ 2007-10-07  4:05 UTC (permalink / raw)
  To: ttn; +Cc: guile-user

> From: Thien-Thi Nguyen <ttn@gnuvola.org>
> 
> for me, it means everyone interested should say what they would
> (or would not) do and then if there is concensus (after some
> refinement), i follow.  if there is no concensus, i muddle
> through the best i can (as always).  from the sound of the
> responses thus far, this is the most likely outcome.

Consensus - same sense or feeling (<-Latin sentire)
Concensus - if that were a word,
            it might mean same head-count

Anyway carry on.  Or muddle on.  My opinion means
little with no code to back it up, and I have none.

>    If you want to harmonize, maybe both branches could
>    think about implementing R6RS library forms.
> 
> the library body is specified to be included in the `library'
> form.  OTOH, `define-module' is a peer top-level form to the
> library body.  how would you reconcile these approaches?

I don't want to rudely inject my opinion, but if
you keep asking quesions it would be rude not to
answer.

I am not totally sure I understand the question.

Are you worried about the systactic difference
between

  (define-module blah blah)
  (def xx)
  (xx xx xx)
  <end-of-file>

versus

  (library blah blah
    (def xx)
    (xx xx xx) )

?

The later (with parentheses on both sides)
seems more lispy to me, but it seems like a
pretty trivial change of syntax.  It would
be more interesting to learn about the deep
magick hidden in the blah blah.

I would leave modules alone for backward
compatibility, and try to add something
with the (library ...) syntax but with an
underlying semantics as much as possible
like the current module system.

Then I would write a paper or manifesto
on the exact reasons why libraries and
modules are too different to be inter-
changeable.

At least, that is how I would reconcile the
two approaches if I were even to begin
reconciliation.  In the real world, I
will type my pipe dream to the mailling
list and then go to bed and not care about
it in the morning.

      -- Keith



_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: rfc (define-module ... #:use-modules ...)
  2007-10-07  4:05     ` Keith Wright
@ 2007-10-07  9:37       ` Thien-Thi Nguyen
  2007-10-07 14:23         ` Ludovic Courtès
  0 siblings, 1 reply; 17+ messages in thread
From: Thien-Thi Nguyen @ 2007-10-07  9:37 UTC (permalink / raw)
  To: Keith Wright; +Cc: guile-user

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

() Keith Wright <kwright@keithdiane.us>
() Sun, 7 Oct 2007 00:05:13 -0400

   Consensus - same sense or feeling (<-Latin sentire)
   Concensus - if that were a word,
               it might mean same head-count

thanks; i stand corrected.

   Anyway carry on.  Or muddle on.  My opinion means
   little with no code to back it up, and I have none.

i appreciate when anyone shares their opinion because
it gives me (some) insight into other points of view.
code is opinions petrified and sometimes worth less.

   Are you worried about the systactic difference
   between [...] ?

yes, precisely.

   The later (with parentheses on both sides)
   seems more lispy to me, but it seems like a
   pretty trivial change of syntax.  It would
   be more interesting to learn about the deep
   magick hidden in the blah blah.

IIUC, first blah in r6rs is `(export EXPORT-SPEC...)'.
second blah is `(import IMPORT-SPEC...)'.

   I would leave modules alone for backward
   compatibility, and try to add something
   with the (library ...) syntax but with an
   underlying semantics as much as possible
   like the current module system.

   Then I would write a paper or manifesto
   on the exact reasons why libraries and
   modules are too different to be inter-
   changeable.

   At least, that is how I would reconcile the
   two approaches if I were even to begin
   reconciliation.  In the real world, I
   will type my pipe dream to the mailling
   list and then go to bed and not care about
   it in the morning.

sounds reasonable.  below is a work-in-progress sketch
that dreamers (-: or insomniacs who want to dream) might
find interesting.  the manifesto is still bubbling, but
only time will tell...

thi

___________________________________________________________

[-- Attachment #2: where to put the parens?! --]
[-- Type: application/x-tar, Size: 4350 bytes --]

[-- Attachment #3: Type: text/plain, Size: 140 bytes --]

_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user

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

* Re: rfc (define-module ... #:use-modules ...)
  2007-10-07  9:37       ` Thien-Thi Nguyen
@ 2007-10-07 14:23         ` Ludovic Courtès
  2007-10-07 15:15           ` Thien-Thi Nguyen
  0 siblings, 1 reply; 17+ messages in thread
From: Ludovic Courtès @ 2007-10-07 14:23 UTC (permalink / raw)
  To: guile-user

Hi!

Thien-Thi Nguyen <ttn@gnuvola.org> writes:

> sounds reasonable.  below is a work-in-progress sketch
> that dreamers (-: or insomniacs who want to dream) might
> find interesting.  the manifesto is still bubbling, but
> only time will tell...

I'm not sure I fully understand what `check-r6rs-library' does (and I
don't have `(ice-9 accumulate)' also...).

At any rate, one thing that is sure is that unfortunately, we don't have
phase separation in Guile (unless Guile 1.4 significantly diverged from
1.[68] in that respect).  Since this is one of the foundations of R6RS
libraries, we'd have a hard time implementing them.  My guess is that
we'd better rewrite the interpreter altogether (in Scheme or a subset
thereof) to have one more "manageable", amenable to deep changes like
this...

Thanks,
Ludovic.



_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: rfc (define-module ... #:use-modules ...)
  2007-10-07 14:23         ` Ludovic Courtès
@ 2007-10-07 15:15           ` Thien-Thi Nguyen
  2007-10-07 17:11             ` Ludovic Courtès
  0 siblings, 1 reply; 17+ messages in thread
From: Thien-Thi Nguyen @ 2007-10-07 15:15 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guile-user

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

() ludo@gnu.org (Ludovic Courtès)
() Sun, 07 Oct 2007 16:23:55 +0200

   I'm not sure I fully understand what `check-r6rs-library'
   does (and I don't have `(ice-9 accumulate)' also...).

to give you an idea, i have appended the output of running the
`compile-command' (see the Local Variables at eof).  the module
(ice-9 accumulate) is a "reduced strength (ice-9 q)" that started
out as just a pet for hobbit (long term goal: aiming for that cool
super-\beta optimization), but turned out to be a good fit in many
contexts.

   My guess is that we'd better rewrite the interpreter altogether
   (in Scheme or a subset thereof) to have one more "manageable",
   amenable to deep changes like this...

towards this end, another approach is to integrate hobbit and gcc.
an interpreter would fall out of that (somewhere, at some point).

thi



[-- Attachment #2: mostly ok but not hogwash --]
[-- Type: text/plain, Size: 15345 bytes --]

checking:  ex-6-4-macros.r6rs
checking:    <library>
checking:      <library-name>
ok:            <library-name> is `(my-helpers id-stuff)'
checking:      (export <export-spec> ...)
ok:              one <export-spec> is `find-dup'
ok:            (export <export-spec> ...) count: 1
checking:      (import <import-spec> ...)
checking:        <import-set>
checking:          <library-reference>
ok:                <library-reference> is `(r6rs)'
ok:              one <import-set> is `(r6rs)'
ok:              one <import-spec> is `(r6rs)'
ok:            (import <import-spec> ...) count: 1
ok:          one <definition> is `(define (find-dup l) ...)'
ok:          rest forms count: 1
ok:          <library> syntax
ok:          known: defs
ok:               :   (lambda (l) (and (pair? l) (let loop ((rest (cdr l))) (cond [ (null? rest) (find-dup (cdr l)) ] [ (bound-identifier=? (car l) (car rest)) (car rest) ] [else (loop (cdr rest)) ]))))
ok:          known: names
ok:               :   find-dup
checking:    <library>
checking:      <library-name>
ok:            <library-name> is `(my-helpers values-stuff)'
checking:      (export <export-spec> ...)
ok:              one <export-spec> is `mvlet'
ok:            (export <export-spec> ...) count: 1
checking:      (import <import-spec> ...)
checking:        <import-set>
checking:          <library-reference>
ok:                <library-reference> is `(r6rs)'
ok:              one <import-set> is `(r6rs)'
ok:              one <import-spec> is `(r6rs)'
checking:        <import-spec> `for'
checking:          <import-set>
checking:            <library-reference>
ok:                  <library-reference> is `(my-helpers id-stuff)'
ok:                one <import-set> is `(my-helpers id-stuff)'
ok:                one <import-level> is `expand'
ok:              one <import-spec> is `(for (my-helpers id-stuff) expand)'
ok:            (import <import-spec> ...) count: 2
ok:          one <definition> is `(define-syntax mvlet ...)'
ok:          rest forms count: 1
ok:          <library> syntax
ok:          known: defs
ok:               :   (lambda (stx) (syntax-case stx () [ (_ [ (id ...) expr] body0 body ...) (not (find-dup (syntax (id ...)))) (syntax (call-with-values (lambda () expr) (lambda (id ...) body0 body ...))) ]))
ok:          known: names
ok:               :   mvlet
checking:    <library>
checking:      <library-name>
ok:            <library-name> is `(let-div)'
checking:      (export <export-spec> ...)
ok:              one <export-spec> is `let-div'
ok:            (export <export-spec> ...) count: 1
checking:      (import <import-spec> ...)
checking:        <import-set>
checking:          <library-reference>
ok:                <library-reference> is `(r6rs)'
ok:              one <import-set> is `(r6rs)'
ok:              one <import-spec> is `(r6rs)'
checking:        <import-set>
checking:          <library-reference>
ok:                <library-reference> is `(my-helpers values-stuff)'
ok:              one <import-set> is `(my-helpers values-stuff)'
ok:              one <import-spec> is `(my-helpers values-stuff)'
checking:        <import-set>
checking:          <library-reference>
ok:                <library-reference> is `(r6rs r5rs)'
ok:              one <import-set> is `(r6rs r5rs)'
ok:              one <import-spec> is `(r6rs r5rs)'
ok:            (import <import-spec> ...) count: 3
ok:          one <definition> is `(define (quotient+remainder n d) ...)'
ok:          one <definition> is `(define-syntax let-div ...)'
ok:          rest forms count: 2
ok:          <library> syntax
ok:          known: defs
ok:               :   (lambda (n d) (let ([q (quotient n d) ]) (values q (- n (* q d)))))
ok:               :   (syntax-rules () [ (_ n d (q r) body0 body ...) (mvlet [ (q r) (quotient+remainder n d) ] body0 body ...) ])
ok:          known: names
ok:               :   quotient+remainder
ok:               :   let-div
ok:        ex-6-4-macros.r6rs
checking:  ex-6-4.r6rs
checking:    <library>
checking:      <library-name>
ok:            <library-name> is `(stack)'
checking:      (export <export-spec> ...)
ok:              one <export-spec> is `make'
ok:              one <export-spec> is `push!'
ok:              one <export-spec> is `pop!'
ok:              one <export-spec> is `empty!'
ok:            (export <export-spec> ...) count: 4
checking:      (import <import-spec> ...)
checking:        <import-set>
checking:          <library-reference>
ok:                <library-reference> is `(r6rs)'
ok:              one <import-set> is `(r6rs)'
ok:              one <import-spec> is `(r6rs)'
ok:            (import <import-spec> ...) count: 1
ok:          one <definition> is `(define (make) ...)'
ok:          one <definition> is `(define (push! s v) ...)'
ok:          one <definition> is `(define (pop! s) ...)'
ok:          one <definition> is `(define (empty! s) ...)'
ok:          rest forms count: 4
ok:          <library> syntax
ok:          known: defs
ok:               :   (lambda () (list (quote ())))
ok:               :   (lambda (s v) (set-car! s (cons v (car s))))
ok:               :   (lambda (s) (let ([v (caar s) ]) (set-car! s (cdar s)) v))
ok:               :   (lambda (s) (set-car! s (quote ())))
ok:          known: names
ok:               :   make
ok:               :   push!
ok:               :   pop!
ok:               :   empty!
checking:    <library>
checking:      <library-name>
ok:            <library-name> is `(balloons)'
checking:      (export <export-spec> ...)
ok:              one <export-spec> is `make'
ok:              one <export-spec> is `push'
ok:              one <export-spec> is `pop'
ok:            (export <export-spec> ...) count: 3
checking:      (import <import-spec> ...)
checking:        <import-set>
checking:          <library-reference>
ok:                <library-reference> is `(r6rs)'
ok:              one <import-set> is `(r6rs)'
ok:              one <import-spec> is `(r6rs)'
ok:            (import <import-spec> ...) count: 1
ok:          one <definition> is `(define (make w h) ...)'
ok:          one <definition> is `(define (push b amt) ...)'
ok:          one <definition> is `(define (pop b) ...)'
ok:          rest forms count: 3
ok:          <library> syntax
ok:          known: defs
ok:               :   (lambda (w h) (cons w h))
ok:               :   (lambda (b amt) (cons (- (car b) amt) (+ (cdr b) amt)))
ok:               :   (lambda (b) (display "Boom! ") (display (* (car b) (cdr b))) (newline))
ok:          known: names
ok:               :   make
ok:               :   push
ok:               :   pop
checking:    <library>
checking:      <library-name>
ok:            <library-name> is `(party)'
checking:      (export <export-spec> ...)
checking:        (rename (<identifier> <identifier>) ...)
checking:          (<identifier> <identifier>)
ok:                (<identifier> <identifier>) is `(balloon:make make)'
checking:          (<identifier> <identifier>)
ok:                (<identifier> <identifier>) is `(balloon:push push)'
ok:              one <export-spec> is `(rename (balloon:make make) (balloon:push push))'
ok:              one <export-spec> is `push!'
ok:              one <export-spec> is `make-party'
checking:        (rename (<identifier> <identifier>) ...)
checking:          (<identifier> <identifier>)
ok:                (<identifier> <identifier>) is `(party-pop! pop!)'
ok:              one <export-spec> is `(rename (party-pop! pop!))'
ok:            (export <export-spec> ...) count: 4
checking:      (import <import-spec> ...)
checking:        <import-set>
checking:          <library-reference>
ok:                <library-reference> is `(r6rs)'
ok:              one <import-set> is `(r6rs)'
ok:              one <import-spec> is `(r6rs)'
checking:        <import-set>
checking:          <import-set>
checking:            <library-reference>
ok:                  <library-reference> is `(stack)'
ok:                one <import-set> is `(stack)'
ok:              one <import-set> is `(only (stack) make push! pop!)'
ok:              one <import-spec> is `(only (stack) make push! pop!)'
checking:        <import-set>
checking:          <import-set>
checking:            <library-reference>
ok:                  <library-reference> is `(balloons)'
ok:                one <import-set> is `(balloons)'
ok:              one <import-set> is `(prefix (balloons) balloon:)'
ok:              one <import-spec> is `(prefix (balloons) balloon:)'
ok:            (import <import-spec> ...) count: 3
ok:          one <definition> is `(define (make-party) ...)'
ok:          one <definition> is `(define (party-pop! p) ...)'
ok:          rest forms count: 2
ok:          <library> syntax
ok:          known: defs
ok:               :   (lambda () (let ([s (make) ]) (push! s (balloon:make 10 10)) (push! s (balloon:make 12 9)) s))
ok:               :   (lambda (p) (balloon:pop (pop! p)))
ok:          known: names
ok:               :   make-party
ok:               :   party-pop!
checking:    <library>
checking:      <library-name>
ok:            <library-name> is `(main)'
checking:      (export <export-spec> ...)
ok:            (export <export-spec> ...) count: 0
checking:      (import <import-spec> ...)
checking:        <import-set>
checking:          <library-reference>
ok:                <library-reference> is `(r6rs)'
ok:              one <import-set> is `(r6rs)'
ok:              one <import-spec> is `(r6rs)'
checking:        <import-set>
checking:          <library-reference>
ok:                <library-reference> is `(party)'
ok:              one <import-set> is `(party)'
ok:              one <import-spec> is `(party)'
ok:            (import <import-spec> ...) count: 2
ok:          one <definition> is `(define p ...)'
ok:          one <expression> is `(pop! p)'
ok:          one <expression> is `(push! p (push (make 5 5) 1))'
ok:          one <expression> is `(pop! p)'
ok:          rest forms count: 4
ok:          <library> syntax
ok:          known: defs
ok:               :   (make-party)
ok:          known: names
ok:               :   p
ok:        ex-6-4.r6rs
checking:  hello.r6rs
checking:    <library>
checking:      <library-name>
checking:        <version>
ok:              <version> is `(42 33 21)'
ok:            <library-name> is `(foo bar zzz (42 33 21))'
checking:      (export <export-spec> ...)
ok:              one <export-spec> is `nothing'
checking:        (rename (<identifier> <identifier>) ...)
checking:          (<identifier> <identifier>)
ok:                (<identifier> <identifier>) is `(foo bar)'
checking:          (<identifier> <identifier>)
ok:                (<identifier> <identifier>) is `(xxx yy)'
ok:              one <export-spec> is `(rename (foo bar) (xxx yy))'
ok:              one <export-spec> is `is'
ok:              one <export-spec> is `actually'
checking:        (rename (<identifier> <identifier>) ...)
checking:          (<identifier> <identifier>)
ok:                (<identifier> <identifier>) is `(a b)'
checking:          (<identifier> <identifier>)
ok:                (<identifier> <identifier>) is `(c d)'
ok:              one <export-spec> is `(rename (a b) (c d))'
ok:              one <export-spec> is `here'
ok:            (export <export-spec> ...) count: 6
checking:      (import <import-spec> ...)
checking:        <import-spec> `for'
checking:          <import-set>
checking:            <import-set>
checking:              <library-reference>
ok:                    <library-reference> is `(sdl misc-utils)'
ok:                  one <import-set> is `(sdl misc-utils)'
ok:                one <import-set> is `(prefix (sdl misc-utils) MISC:)'
ok:                one <import-level> is `run'
ok:              one <import-spec> is `(for (prefix (sdl misc-utils) MISC:) run)'
checking:        <import-set>
checking:          <library-reference>
checking:            <version-reference>
ok:                  <subversion-reference> is `42'
checking:              <subversion-condition>
checking:                <subversion-condition>
checking:                  <subversion-condition>
ok:                        <subversion-condition> is `(<= 22)'
checking:                  <subversion-condition>
ok:                        <subversion-condition> is `(>= 44)'
ok:                      <subversion-condition> is `(and (<= 22) (>= 44))'
ok:                    <subversion-condition> is `(not (and (<= 22) (>= 44)))'
ok:                  <subversion-reference> is `(not (and (<= 22) (>= 44)))'
checking:              <subversion-condition>
checking:                <subversion-condition>
ok:                      <subversion-condition> is `(<= 22)'
checking:                <subversion-condition>
ok:                      <subversion-condition> is `(>= 42)'
ok:                    <subversion-condition> is `(or (<= 22) (>= 42))'
ok:                  <subversion-reference> is `(or (<= 22) (>= 42))'
ok:                  <version-reference> count: 3
ok:                <library-reference> is `(ice-9 foo (42 (not (and (<= 22) (>= 44))) (or (<= 22) (>= 42))))'
ok:              one <import-set> is `(ice-9 foo (42 (not (and (<= 22) (>= 44))) (or (<= 22) (>= 42))))'
ok:              one <import-spec> is `(ice-9 foo (42 (not (and (<= 22) (>= 44))) (or (<= 22) (>= 42))))'
ok:            (import <import-spec> ...) count: 2
ok:          one <definition> is `(define ((a b) c) ...)'
ok:          one <expression> is `((a 10) 20)'
ok:          rest forms count: 2
ok:          <library> syntax
ok:          known: defs
ok:               :   (lambda (b) (lambda (c) (+ b c)))
ok:          known: names
ok:               :   a
ok:        hello.r6rs
checking:  hogwash.r6rs
checking:    <library>
checking:      <library-name>
checking:        <version>
ok:              <version> is `(42 33 21)'
ok:            <library-name> is `(foo bar zzz (42 33 21))'
checking:      (export <export-spec> ...)
ok:              one <export-spec> is `nothing'
checking:        (rename (<identifier> <identifier>) ...)
checking:          (<identifier> <identifier>)
ok:                (<identifier> <identifier>) is `(foo bar)'
ok:              one <export-spec> is `(rename (foo bar))'
ok:              one <export-spec> is `is'
ok:              one <export-spec> is `actually'
checking:        (rename (<identifier> <identifier>) ...)
checking:          (<identifier> <identifier>)
ok:                (<identifier> <identifier>) is `(a b)'
checking:          (<identifier> <identifier>)
ok:                (<identifier> <identifier>) is `(c d)'
ok:              one <export-spec> is `(rename (a b) (c d))'
ok:              one <export-spec> is `here'
ok:            (export <export-spec> ...) count: 6
checking:      (import <import-spec> ...)
checking:        <import-set>
checking:          <import-set>
checking:            <library-reference>
ok:                  <library-reference> is `(foo bar baz)'
ok:                one <import-set> is `(foo bar baz)'
ok:              one <import-set> is `(prefix (foo bar baz) SDL:)'
ok:              one <import-spec> is `(prefix (foo bar baz) SDL:)'
ok:            (import <import-spec> ...) count: 1
ok:          one <definition> is `(define (a b) ...)'
ok:          one <expression> is `(a 19)'
hogwash.r6rs:16:3: bad `define' placement: `(define f ...)'
 (while checking <library>)
 (while checking hogwash.r6rs)
ERROR: syntax error

[-- Attachment #3: Type: text/plain, Size: 140 bytes --]

_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user

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

* Re: rfc (define-module ... #:use-modules ...)
  2007-10-07 15:15           ` Thien-Thi Nguyen
@ 2007-10-07 17:11             ` Ludovic Courtès
  0 siblings, 0 replies; 17+ messages in thread
From: Ludovic Courtès @ 2007-10-07 17:11 UTC (permalink / raw)
  To: guile-user

Hi,

Thien-Thi Nguyen <ttn@gnuvola.org> writes:

> to give you an idea, i have appended the output of running the
> `compile-command' (see the Local Variables at eof).

Thanks, I have a better understanding now.

> towards this end, another approach is to integrate hobbit and gcc.
> an interpreter would fall out of that (somewhere, at some point).

Integrating anything into GCC seems like a hard job (although I've never
actually tried).  Besides, I'd personally prefer to have most code
written in Scheme, and writing a GCC front-end is not going to be the
best way to achieve this.

Anyway, this is all a long way off, I'm afraid...  ;-)

Thanks,
Ludovic.



_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

end of thread, other threads:[~2007-10-07 17:11 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-04 14:10 rfc (define-module ... #:use-modules ...) Thien-Thi Nguyen
2007-10-04 15:29 ` Ludovic Courtès
2007-10-04 18:40   ` Thien-Thi Nguyen
2007-10-04 15:30 ` Mike Gran
2007-10-04 16:29   ` Ludovic Courtès
2007-10-04 19:12   ` Thien-Thi Nguyen
2007-10-04 17:14 ` Clinton Ebadi
2007-10-04 19:09   ` Thien-Thi Nguyen
2007-10-04 19:21   ` Klaus Schilling
2007-10-04 19:18 ` Klaus Schilling
2007-10-05 23:47 ` Keith Wright
2007-10-06  9:59   ` Thien-Thi Nguyen
2007-10-07  4:05     ` Keith Wright
2007-10-07  9:37       ` Thien-Thi Nguyen
2007-10-07 14:23         ` Ludovic Courtès
2007-10-07 15:15           ` Thien-Thi Nguyen
2007-10-07 17:11             ` Ludovic Courtès

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