chicken-hackers
[Top][All Lists]
Advanced

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

[Chicken-hackers] r7rs modules


From: Peter Bex
Subject: [Chicken-hackers] r7rs modules
Date: Sat, 10 Nov 2012 22:10:31 +0100
User-agent: Mutt/1.4.2.3i

Hi all,

I think we should slowly get started thinking about supporting r7rs.
One of the things that I'm wondering about is how to best handle
modules.  R7rs has module names which are lists, ie (scheme base).

This won't work cleanly with native Chicken modules.  For example,
(use (scheme base)) will give an error (which would be extensible),
but does (use (only x y)) imply loading a module named (ONLY X Y)
or does it imply loading X and importing only the Y identifier?

Also, (module foo = (scheme base)) does mean "instantiate the functor
named SCHEME with the module named BASE", or does it mean "FOO is
an alias for (SCHEME BASE)".

One way to do this would be to extend our own "native" syntax to
allow complex module names that are vectors:
(use #(only x y)) will unambiguously load the module named #(ONLY X Y)
while (use (only x y)) will unambiguously load the module named X
and import only identified Y.

Then, when we implement the standard modules, we could rewrite all
lists that are module names to our native vectors.

I think this is very ugly though, so we could consider trying to
convince the R7RS process to reconsider composite module names
(highly unlikely to happen at this stage), or we could make a clean
break with Chicken 5 like we did with Chicken 4 and allow ONLY the
R7RS module syntax (this would be very hard on our users, and a lot
of work for ourselves, too).

Ideas?

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth



reply via email to

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