chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] reloading dso files


From: Mark Baily
Subject: [Chicken-users] reloading dso files
Date: Sat, 5 Feb 2005 09:04:03 +1100

Hello,
Say I have some files like this:

address@hidden chick]$ cat test.scm
#>!
int func1(void);
int func2(int i);
int func3(double d);
<#


(define (scheme-func)
 4)

address@hidden chick]$ cat functions.c
#include <stdio.h>

int func1(void)
{
        printf("func1-1\n");
        return 1;
}

int func2(int i)
{
        return i;
}

int func3(double d)
{
        return d*d;
}
address@hidden chick]$ exit

I compile this as a dso as so..

csc -s test.scm functions.c -o test.o1

....and load it into a running chicken like so....

(require "test.o1")

What I want to do is to dynamically change the definitions of the functions
here, say change func2 to return i*i, and change scheme-func to return 10.
Then recompile and reload like so..

csc -s test.scm functions.c -o test.o2
(require "test.o2")

I find that the change to scheme functions is reflected but the change to
C functions is not. Is there a way to get it to use the new C functions?
(You can do this in Gambit-C).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]