Hi,
I compiled my ECL lisp functions with asdf:make-build into a library.
Some functions depend on the value of a global variable which has to be set
in the code using the library.
But when changing the value of the global variable in the code using the
library, the library functions still use the old value...
What can I do?
===
Here a simplified example using a global integer variable:
The global variable is declared in a header file
--- context.h ---
extern int global_int;
---
and defined in
--- context.cpp ---
int global_int = 123;
---
It is used in the following lisp function (test) defined in the library:
---
(ffi:clines "#include \"context.h\"")
(defun test () (ffi:c-inline () () :void "myprint(global_int);"))
---
When printing the value from the main program, which includes the header
file context.h as well, changing the value to 456 and printing again works
as expected:
---
#include "context.h"
myprint(global_int);
global_int = 456;
myprint(global_int);
---
results in the following being printed:
---
123
456
---
But when evaluating (test) before and after the value is changed, in both
cases the original value is printed:
---
123
123
---
What can I do to make the lisp function defined in the library use the new
updated value?
Thanks,
Dietrich
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list