>From e7ed3aa99b6895194493e7df52591348839294c2 Mon Sep 17 00:00:00 2001 From: Evan Hanson Date: Mon, 16 Oct 2017 08:21:39 +1300 Subject: [PATCH] Add unit dependency info to the scheme and rnrs[-null] modules The r4rs module depends on the "library" unit, so we add that dependency to its module registration in modules.scm. The r[45]rs-null modules don't depend on any unit since they only export syntax, so set their module-library slots to #f to indicate "no unit". The scheme module only depends on the "library" unit, so remove it from the list of `core-unit-requirements` and add "library" to its module registration so that it's treated like any other unit. Add a test to make sure the r4rs and r4-null libraries are working. --- eval.scm | 6 +++--- modules.scm | 10 +++++----- tests/module-tests.scm | 12 ++++++++++++ 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/eval.scm b/eval.scm index 10162865..dbdab377 100644 --- a/eval.scm +++ b/eval.scm @@ -894,10 +894,10 @@ (define-foreign-variable install-lib-name c-string "C_INSTALL_LIB_NAME") (define-foreign-variable uses-soname? bool "C_USES_SONAME") +;;; Core unit information + (define-constant core-unit-requirements - '((scheme ; XXX not totally correct, also needs eval - . (##core#require library)) - (chicken.foreign + '((chicken.foreign . (##core#require-for-syntax chicken-ffi-syntax)) (chicken.condition . (##core#begin diff --git a/modules.scm b/modules.scm index f71519b6..8d99a0f4 100644 --- a/modules.scm +++ b/modules.scm @@ -941,13 +941,13 @@ ;; ##sys#initial-macro-environment and thus always available inside ;; modules. ##sys#default-macro-environment)) - (##sys#register-primitive-module 'r4rs r4rs-values r4rs-syntax) - (##sys#register-primitive-module - 'scheme + (##sys#register-core-module 'r4rs 'library r4rs-values r4rs-syntax) + (##sys#register-core-module + 'scheme 'library (append '(dynamic-wind values call-with-values) r4rs-values) r4rs-syntax) - (##sys#register-primitive-module 'r4rs-null '() r4rs-syntax) - (##sys#register-primitive-module 'r5rs-null '() r4rs-syntax)) + (##sys#register-core-module 'r4rs-null #f '() r4rs-syntax) + (##sys#register-core-module 'r5rs-null #f '() r4rs-syntax)) (##sys#register-module-alias 'r5rs 'scheme) (##sys#register-module-alias 'srfi-88 'chicken.keyword) diff --git a/tests/module-tests.scm b/tests/module-tests.scm index e6969e76..12d63bc4 100644 --- a/tests/module-tests.scm +++ b/tests/module-tests.scm @@ -10,6 +10,18 @@ (test-begin "modules") +(test-assert + "r4rs" + (module test-r4rs () + (import r4rs) + (equal? 1 1))) + +(test-assert + "r4rs-null" + (module test-r4rs-null () + (import r4rs-null) + (begin #t))) + (test-equal "internal/variable" (module foo (abc def) (import scheme) -- 2.11.0