This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: supporting dynamic/interactive procedure re-definition
- From: Helmut Eller <eller dot helmut at gmail dot com>
- To: kawa at sources dot redhat dot com
- Date: Mon, 04 Oct 2010 08:10:21 +0200
- Subject: Re: supporting dynamic/interactive procedure re-definition
- References: <4C84717B.5080103@bothner.com>
* Per Bothner [2010-09-06 04:43] writes:
> There are probably other limitations (and bugs); please let me know.
Let's assume we have a file /tmp/foo.scm containing:
(module-export foo)
(module-static #t)
(module-compile-options
warn-invoke-unknown-method: #t
warn-undefined-variable: #t)
(define (foo) (bar))
(define (bar) (format #t "version 1\n"))
Then start the interpreter with kawa --no-inline
and do this:
#|kawa:1|# (require "/tmp/foo.scm")
/tmp/foo.scm:9:15: warning - no declaration seen for format
#|kawa:2|# (define baz foo)
#|kawa:3|# (foo)
version 1
#|kawa:4|# (baz)
version 1
So far so good. Now let's change the function bar in the file to:
(define (bar) (format #t "version 2\n"))
and continue with this
#|kawa:5|# (require "/tmp/foo.scm")
/tmp/foo.scm:9:15: warning - no declaration seen for format
#|kawa:6|# (foo)
version 2
#|kawa:7|# (baz)
version 1
#|kawa:8|#
Isn't baz supposed to call version 2?
Also isn't there a more direct way to call non-exported toplevel
functions? E.g. there could be a namespace for the module foo and
foo:bar could refer the non-exported function.
Helmut