lambda-like expressions for C



hey all,

I was wondering if anybody knew of a lambda-like expression api for C... what I'm looking
for is something like:

int variable = 15;
lambda ("if (_1 < 50) fprintf(stderr, \"HERE -- %d\", _1); ", variable);

where the first string would be evaluated at run-time, and execute the code, substituting
the value in 'variable' for _1. (sort of like fprintf, except the strings that 'lambda' 
would take would support a subset of the c-api)

what I'm ultimately looking for is the ability to take this string from a file 
(or other source), and reconfigure what the program is doing on the fly, without 
recompiling. Ultimately, I want to use this for debugging purposes - ie: being able 
to debug programs via configuration file without a debugger.

Does anyone know an api like this/one that is available? If there isn't, would the glib 
team be interested in helping design one, and integrating it into glib?

Ed



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