likely be a module returned by @code{resolve-interface}.
@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
@subsection Included Guile Modules
Load a file in the current module.
@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
List current bindings.
@end deffn
(try-module-autoload name version))
(define (reload-module m)
+ "Revisit the source file corresponding to the module @var{m}."
(let ((f (module-filename m)))
(if f
(save-module-excursion
(define *command-table*
'((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))
(compile (compile c) (compile-file cc)
(disassemble x) (disassemble-file xx))
Load a file in the current module."
(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)
"binding
List current bindings."