chicken-hackers
[Top][All Lists]
Advanced

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

[Chicken-hackers] [PATCH] Add the "scheme" module to get prefixes on the


From: Peter Bex
Subject: [Chicken-hackers] [PATCH] Add the "scheme" module to get prefixes on the core library
Date: Wed, 18 Oct 2017 23:49:45 +0200
User-agent: NeoMutt/20170113 (1.7.2)

Hi all,

Attached are two patches that are needed to make the "scheme" module
a real thing.  We could, strictly speaking, keep all the "scheme"
definitions at toplevel, so without a prefix, but doing so muddles
up a lot of things.

Just working on this patch pointed out several issues with various
macros and some incorrect bindings, as well as the fact that some of
our specializations in the types.db are unprefixed (I don't know if
that's really an issue, resulting in unhygienic rewrites of code?)

Furthermore, this makes warning output more consistent and less confusing
to the user.

The first is a *very* large commit (at least, it took me 2 days to write)
but a lot of it is simply repetitive stuff; for every identifier in r5rs
(which are quite a lot!) we must add the prefix in various places.

IMPORTANT: After this, library.scm will (import r5rs-null), which means
it won't be bootstrappable with 5.0.0pre2 anymore.  I think if this
patch is applied, we should immediately make a pre3 so that we can keep
a bootstrappable compiler.

Finally, there's an issue I ran into that we'll probably have to fix
before we remove the soon to be superfluous "chicken" module: the
modules defined in library.scm do not include syntactic exports.
This means if later the module is imported, we can't use macros from
the module.  To get around this, for now I'm importing "chicken" to
get handle-exceptions, when and unless (see the NOTE at the start).
And for r5rs I'm actually importing r5rs-null and reexporting its
macros, so for those core macros it's not an issue.

We could define internal modules like "chicken.condition-null" and
"chicken.base-null" for these in modules.scm so we can do the same
trick as for r5rs-null, but that seems a bit ugly.  Suggestions
are welcome!

Cheers,
Peter

Attachment: 0001-Add-initial-version-of-the-scheme-module.patch
Description: Text Data

Attachment: 0002-Add-import-scheme-and-eval-import-scheme-everywhere.patch
Description: Text Data

Attachment: signature.asc
Description: PGP signature


reply via email to

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