This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Redefining functions interactively
- From: Chris Dean <Chris dot Dean at sokitomi dot com>
- To: Kawa List <kawa at sources dot redhat dot com>
- Date: Tue, 15 Apr 2003 00:37:28 -0700
- Subject: Redefining functions interactively
I would like to redefine functions in a specific module when running
interactively. Is this a supported feature?
For example, assume I have a module Foo that has two functions: "inner"
and "outer". I would like to run kawa interactively, require Foo, and
then redefine the function "inner" and have "outer" use the new "inner".
(module-name <Foo>)
(module-static #t)
(define (inner) 'inner)
(define (outer) (cons 'outer (inner)))
unix% java kawa.repl -C Foo.scm
unix% java kawa.repl -s
#|kawa:1|# (require <Foo>)
#|kawa:2|# (outer)
(outer . inner)
#|kawa:3|# (define (inner) 'inner-2)
#|kawa:4|# (outer)
(outer . inner)
Regards,
Chris Dean