To make variables in your compiled code accessible to the
interpreter in the easiest way, use their pointer. For example
to interactively initialize a function (for example read a
signal profile from a config file):
function signal_profile;
string function_form;
cerr<<"Enter your signal profile expression (a'la blop): ";
getline(cin,function_form);
char cmd[1000];
sprintf(cmd,"(*(function*)%p) = %s",&signal_profile,function_form.c_str());
G__exec_text(cmd);
To be honest, the above code should not be written:
function::formula(const var &)
Makes exactly the same
thing. See blop -h function