1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-02 21:10:27 +02:00

resolve-module uses -module variants

* module/ice-9/boot-9.scm (resolve-module): Use module-define-submodule!
  when binding the root, and nested-ref-module for the hot lookup, which
  is guaranteed to return a module or #f.
This commit is contained in:
Andy Wingo 2010-04-23 15:55:32 +02:00
parent 9e0bfdbaa3
commit d58ccc669c

View file

@ -2400,15 +2400,15 @@ If there is no handler at all, Guile prints an error and then exits."
(let ((root (make-module)))
(set-module-name! root '())
;; Define the-root-module as '(guile).
(module-define! root 'guile the-root-module)
(module-define-submodule! root 'guile the-root-module)
(lambda (name . args) ;; #:optional (autoload #t) (version #f)
(let* ((already (nested-ref root name))
(let* ((already (nested-ref-module root name))
(numargs (length args))
(autoload (or (= numargs 0) (car args)))
(version (and (> numargs 1) (cadr args))))
(cond
((and already (module? already)
((and already
(or (not autoload) (module-public-interface already)))
;; A hit, a palpable hit.
(if (and version