[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: r6rs libraries, round three

From: Julian Graham
Subject: Re: r6rs libraries, round three
Date: Sun, 27 Dec 2009 15:04:47 -0500

Hi all,

Find attached a revised and polished version of the `(ice-9
r6rs-libraries)' module I submitted a couple of months ago.  This
version includes the following changes:

* The library transformer code's been cleaned up and compacted (by
more than 30%) and now uses a `defmacro' form similar to the one used
by `use-modules' and `define-module' instead of the messy
syncase-based transformer it was using originally.

* I've re-organized the code to more closely resemble the structure of
`use-modules' and 'define-module' -- the macros delegate syntax
parsing to a set of "processing" functions.  In addition to making the
macros simpler, this should make it easier to unify the module and
library systems in the future, if desired.

* I've added an `import' macro as specified by R6RS 8.1 "Top Level
Program Syntax" [0].

* The module also supports the convention, specified by SRFI-97, that
SRFIs can be loaded as R6RS libraries by importing them as `(srfi
:[n])' -- my implementation transforms library names of that form to
the form used by Guile, `(srfi srfi-[n])'.

In case anyone missed the earlier emails on this topic, this module
contains macros that transform the R6RS `library' and 'import' forms
into Guile's native `define-module' and 'use-modules' forms.  In
concert with the version and binding export patches that were pushed
last week, this means that Guile now supports R6RS 7 "Libraries" [1],
and can thus share code (unmodified!) with any other conforming Scheme

I consider this version of the code to be tentatively "complete."  You
can try it out by dropping r6rs-libraries.scm into module/ice-9 and
then loading it in the REPL or including it as a dependency of a
normal Guile module.  I'm very interested in any feedback people might
have, particularly when it comes to the name of the module and where
it belongs / when it should be loaded (always?  Not in the REPL?).  If
no one objects, I'll add some documentation and push it.

As I mentioned to Andy on IRC, I'm working on a first pass at a set of
implementations of the R6RS Standard Libraries (minus the work already
done by Ludovic et al on bytevectors, etc.), as much as possible as
wrappers around Guile's existing functionality.  I should have some
status on that soon.


[0] -
[1] -

Attachment: r6rs-libraries.scm
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]