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]

Re: Loading and unloading scheme function definitions.


Bhinderwala, Shoeb <SBhinderwala@wellington.com> wrote:
> Would you have an example of how to bind an unbind a function
> definition in the Scheme environment from Java.

How about this simple example:

        (define my-function (lambda (x) (+ x 1)))
        (format #t "~A~%" (my-function 10))
        (set! my-function (lambda (x) (+ x 2)))
        (format #t "~A~%" (my-function 10))
=>
        11
        12

This shows how to rebind a definition.  As Per says, you need to be
careful if you're using module-static compiled procedures.

Regards,
Chris Dean


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