Exporting a nonexistent variable in a guile module can cause runtime
errors. To see this, consider the following example:
--- mod1.scm ---
(define-module (mod1))
(export myproc)
(define (myproc)
(display "Hello\n"))
--- end ---
--- mod2.scm ---
(define-module (mod2))
(export myproc
>I think Guile could report a warning if a nonexistent variable is
>exported as the cause of this kind of errors may be difficult to find in
>a large program.
During compilation, code is analysed and IIRC there is a warning for unbound
variables. (I don’t know if warning is the default though.)
Here is another example:
--- mod1.scm ---
(define-module (mod1))
(export myproc)
(define (myproc0)
(display "Hello\n"))
--- end ---
--- mod2.scm ---
(define-module (mod2))
(export myproc2)
(use-modules (mod1))
(define (myproc2)
(display "Hello again\n"))
--- end ---
--- program.scm -