chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] r7rs modules


From: Peter Bex
Subject: Re: [Chicken-hackers] r7rs modules
Date: Mon, 12 Nov 2012 09:32:29 +0100
User-agent: Mutt/1.4.2.3i

On Mon, Nov 12, 2012 at 08:51:32AM +0900, Ivan Raikov wrote:
> I also agree that any changes to the module system should be avoided or be
> minimally invasive. I really want to start using functors, any mucking
> around with the module system might destabilize things again.
> 
>   It seems to me that the dash-renaming scheme of r7rs module names will
> work in all important cases. If there are library authors obtuse enough to
> create libraries (foo bar-baz) and (foo-bar baz), perhaps a custom renaming
> map could be used, but I don't think this would be something we need to
> worry about a lot.

At the risk of continuing a bikeshedding discussion, I think a dot or a
#-sign (if that's possible) might be better. Because Schemers tend to
use dashes a lot, the risk of collision is greater with a dash than
with any of these other symbols.  And the hash sign is already used for
module name mangling: uri-generic#uri-reference indicates the
uri-reference identifier from the uri-generic module.

We could easily extend this to scheme#base#+  to indicate the +
identifier from the (scheme base) module.  This would fit neatly with
my proposal of mapping egg modules to be simply wrapped in a list:
(uri-generic) being the r7rs-module representation of the "uri-generic"
module.  The algorithm would be: chop the symbol at the #, pick
the last part as the identifier name and the rest in a list is the
module name.

This should be a minimal change and has no impact on existing
identifiers.  I'm unsure whether it works "out of the box" or
whether it needs some small additional support to allow for
module names to contain hashes.

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]