This is the mail archive of the kawa@sources.redhat.com 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]

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


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