From 91649a0ead8af565c5e0406601ee71c8cda57a57 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Fri, 26 Jun 2015 11:39:54 +0200 Subject: [PATCH] Issue 4462/2: For Scm_module::import, only look at exported variables --- lily/lily-modules.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lily/lily-modules.cc b/lily/lily-modules.cc index f34e7e3041..b5b61ee6bb 100644 --- a/lily/lily-modules.cc +++ b/lily/lily-modules.cc @@ -18,6 +18,7 @@ */ #include "lily-modules.hh" +#include "lily-imports.hh" struct Scm_module::Variable_record { @@ -67,15 +68,21 @@ void Scm_module::import () { assert (SCM_UNBNDP (module_)); - module_ = scm_c_resolve_module (name_); + SCM interface = scm_c_resolve_module (name_); + // Using only the public interface is a voluntary form of access + // control in GUILE. It would be cumbersome to do so until + // Guile_user itself is imported. + if (SCM_MODULEP (Guile_user::module.module_)) + interface = Guile_user::module_public_interface (interface); for (Variable_record *p = variables_; p;) { Variable_record *next = p->next_; - p->var_->import (module_, p->name_); + p->var_->import (interface, p->name_); delete p; p = next; } variables_ = 0; + module_ = interface; } void -- 2.39.5