This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: supporting dynamic/interactive procedure re-definition


* 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]