From: "Julian Graham" <joolean@gmail.com>
To: "Andy Wingo" <wingo@pobox.com>
Cc: Guile User <guile-user@gnu.org>, Neil Jerram <neiljerram@googlemail.com>
Subject: Re: r6rs libraries
Date: Thu, 1 Jan 2009 23:10:55 -0500 [thread overview]
Message-ID: <2bc5f8210901012010g2ebb6effx5c966d0e26fe382b@mail.gmail.com> (raw)
In-Reply-To: <2bc5f8210812282238p1f91f352id7eca5280dc9ff6a@mail.gmail.com>
Happy New Year, Guilers!
> So maybe I'm being dense here, but it looks like the way forward might
> be to whip up a quick module-to-library mapping system (i.e.,
> something like (foo bar (version)) -> /foo/bar/version) and then start
> working on piecemeal attempts to get imports working? Like, in the
> following order, I'd say we could tackle:
>
> 1) Mapping the existing features of Guile's module system onto their
> R6RS counterparts
> 2) Implementing version selection
> 3) Implementing import levels
That last email was written between drinking at a bar and going to
bed. The *proper* mapping for versions would be more like:
(foo bar (version)) -> (foo version bar)
So if your R6RS library name was `(my r6rs library (1 2 3))', then the
corresponding Guile module name would be `(my r6rs 1 2 3 library)'.
I had a little time this afternoon to play around with some syntax
transformations for converting between libraries and modules, which
led to the following observations:
* Any library-to-module transformations we could do would be one-way
(i.e., libraries to modules), since R6RS requires that any non-binding
expressions have to come after the bindings in a library; rewriting a
module to meet that requirement would be non-trivial.
* Module definitions created from R6RS libraries need to use the #:pure keyword.
* There's a somewhat perplexing R6RS requirement to allow renaming
symbols on export, similar to the way Guile currently supports
renaming them on import. I don't see a way to do this without
modifications to the core.
* I think it'd be possible to implement R6RS "import levels" using
Guile's existing #:export, #:export-syntax, #:reexpport, and
#:reexport-syntax keywords -- if it weren't for the `(meta <level>)'
option for import specifiers. It might still be possible, given the
allowances of section 7.2. I don't know, I'm still trying to figure
that out.
Other than the above, it looks like a lot of the heavy lifting has
already been done by the module system.
Regards,
Julian
next prev parent reply other threads:[~2009-01-02 4:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-28 1:05 r6rs libraries (was Re: role of guile-lib) Julian Graham
2008-12-28 11:09 ` r6rs libraries Andy Wingo
2008-12-29 6:38 ` Julian Graham
2009-01-02 4:10 ` Julian Graham [this message]
2009-01-05 23:40 ` Ludovic Courtès
2009-01-06 9:45 ` Andy Wingo
2009-01-11 23:21 ` Julian Graham
2009-01-13 16:17 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2bc5f8210901012010g2ebb6effx5c966d0e26fe382b@mail.gmail.com \
--to=joolean@gmail.com \
--cc=guile-user@gnu.org \
--cc=neiljerram@googlemail.com \
--cc=wingo@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).