mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-07-09 02:50:20 +02:00
add ,reload meta-command and document it and reload-module
* module/ice-9/boot-9.scm (reload-module): Add docstring. * module/system/repl/command.scm (reload): New meta-command. * doc/ref/scheme-using.texi (Module Commands): Document the ,reload meta-command. * doc/ref/api-modules.texi (Module System Reflection): Document reload-module.
This commit is contained in:
parent
626e36e5cb
commit
cdab9fc625
4 changed files with 20 additions and 1 deletions
|
@ -563,6 +563,11 @@ arguments should be module objects, and @var{interface} should very
|
||||||
likely be a module returned by @code{resolve-interface}.
|
likely be a module returned by @code{resolve-interface}.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
|
@deffn {Scheme Procedure} reload-module module
|
||||||
|
Revisit the source file that corresponds to @var{module}. Raises an
|
||||||
|
error if no source file is associated with the given module.
|
||||||
|
@end deffn
|
||||||
|
|
||||||
|
|
||||||
@node Included Guile Modules
|
@node Included Guile Modules
|
||||||
@subsection Included Guile Modules
|
@subsection Included Guile Modules
|
||||||
|
|
|
@ -223,6 +223,10 @@ Import modules / List those imported.
|
||||||
Load a file in the current module.
|
Load a file in the current module.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
|
@deffn {REPL Command} reload [module]
|
||||||
|
Reload the given module, or the current module if none was given.
|
||||||
|
@end deffn
|
||||||
|
|
||||||
@deffn {REPL Command} binding
|
@deffn {REPL Command} binding
|
||||||
List current bindings.
|
List current bindings.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
|
@ -2276,6 +2276,7 @@ VALUE."
|
||||||
(try-module-autoload name version))
|
(try-module-autoload name version))
|
||||||
|
|
||||||
(define (reload-module m)
|
(define (reload-module m)
|
||||||
|
"Revisit the source file corresponding to the module @var{m}."
|
||||||
(let ((f (module-filename m)))
|
(let ((f (module-filename m)))
|
||||||
(if f
|
(if f
|
||||||
(save-module-excursion
|
(save-module-excursion
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
|
|
||||||
(define *command-table*
|
(define *command-table*
|
||||||
'((help (help h) (show) (apropos a) (describe d))
|
'((help (help h) (show) (apropos a) (describe d))
|
||||||
(module (module m) (import use) (load l) (binding b) (in))
|
(module (module m) (import use) (load l) (reload re) (binding b) (in))
|
||||||
(language (language L))
|
(language (language L))
|
||||||
(compile (compile c) (compile-file cc)
|
(compile (compile c) (compile-file cc)
|
||||||
(disassemble x) (disassemble-file xx))
|
(disassemble x) (disassemble-file xx))
|
||||||
|
@ -391,6 +391,15 @@ Import modules / List those imported."
|
||||||
Load a file in the current module."
|
Load a file in the current module."
|
||||||
(load (->string file)))
|
(load (->string file)))
|
||||||
|
|
||||||
|
(define-meta-command (reload repl . args)
|
||||||
|
"reload [MODULE]
|
||||||
|
Reload the given module, or the current module if none was given."
|
||||||
|
(pmatch args
|
||||||
|
(() (reload-module (current-module)))
|
||||||
|
((,mod-name) (guard (list? mod-name))
|
||||||
|
(reload-module (resolve-module mod-name)))
|
||||||
|
(,mod-name (reload-module (resolve-module mod-name)))))
|
||||||
|
|
||||||
(define-meta-command (binding repl)
|
(define-meta-command (binding repl)
|
||||||
"binding
|
"binding
|
||||||
List current bindings."
|
List current bindings."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue