Redefining functions interactively

Chris Dean Chris.Dean@sokitomi.com
Tue Apr 15 07:37:00 GMT 2003


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



More information about the Kawa mailing list