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:
parent
9e0bfdbaa3
commit
d58ccc669c
1 changed files with 3 additions and 3 deletions
|
@ -2400,15 +2400,15 @@ If there is no handler at all, Guile prints an error and then exits."
|
||||||
(let ((root (make-module)))
|
(let ((root (make-module)))
|
||||||
(set-module-name! root '())
|
(set-module-name! root '())
|
||||||
;; Define the-root-module as '(guile).
|
;; 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)
|
(lambda (name . args) ;; #:optional (autoload #t) (version #f)
|
||||||
(let* ((already (nested-ref root name))
|
(let* ((already (nested-ref-module root name))
|
||||||
(numargs (length args))
|
(numargs (length args))
|
||||||
(autoload (or (= numargs 0) (car args)))
|
(autoload (or (= numargs 0) (car args)))
|
||||||
(version (and (> numargs 1) (cadr args))))
|
(version (and (> numargs 1) (cadr args))))
|
||||||
(cond
|
(cond
|
||||||
((and already (module? already)
|
((and already
|
||||||
(or (not autoload) (module-public-interface already)))
|
(or (not autoload) (module-public-interface already)))
|
||||||
;; A hit, a palpable hit.
|
;; A hit, a palpable hit.
|
||||||
(if (and version
|
(if (and version
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue