From 20035ec2cbd28d9fa0f6133a404acd59c4c5f5e4 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Tue, 31 Oct 2017 21:00:39 +0100 Subject: [PATCH] Add module hack so library.scm can refer to built-in core macros This is necessary because library.scm is defining some modules, from which it also uses macros. For "scheme" this is possible because it is built-in as a special case but for srfi-12/(chicken condition) and (chicken base) we can't import them from those libraries themselves. Currently we get by through the "chicken" module which contains secondary exports for all these macros because they used to be available from that module, but the "chicken" module will disappear soonish. This commit is in preparation for the drop of the "chicken" module, which can then be done once we make a prerelease snapshot containing this change. We can then add the following import to library.scm: (import (chicken internal built-in-core-macros)) The module's name is intentionally long and contains references to "internal" and "built-in" and "core" to be vague and dissuasive so that nobody will start using them (or at least on their own risk). --- modules.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules.scm b/modules.scm index c1895127..653baba0 100644 --- a/modules.scm +++ b/modules.scm @@ -1075,6 +1075,10 @@ (define-inline (se-subset names env) (map (cut assq <> env) names)) +;; Hack for library.scm to use macros from modules it defines itself. +(##sys#register-core-module + 'chicken.internal.built-in-core-macros #f '() (##sys#macro-environment)) + (##sys#register-core-module 'chicken.module #f '() ##sys#chicken.module-macro-environment) -- 2.11.0