Hi Ludo,
On 01/04/12 13:17, Ludovic Courtès wrote:
If the users files are evaluated rather than compiled/loaded, this is
not a problem:
I do *all* guile processing via the ag_scm_c_eval_string_from_file_line
function. I suck up a string from my input file, determine that it
needs guile processing and invoke that function. It has this profile:
SCM
ag_scm_c_eval_string_from_file_line(
char const * pzExpr, char const * pzFile, int line);
#define SCM_EVAL_CONST(_s) \
do { static file_line_t const fl = { __LINE__ - 1, __FILE__, _s }; \
pzLastScheme = fl.text; \
ag_scm_c_eval_string_from_file_line(fl.text, fl.file, fl.line); \
} while (0)
and I *can* redefine define because I start Guile with my own
initialization:
#define SCHEME_INIT_FILE "directive.h"
static const int schemeLine = __LINE__+2;
static char const zSchemeInit[3846] = // this is generated code...
"(use-modules (ice-9 common-list))\n\
..................................";
pzLastScheme = zSchemeInit;
ag_scm_c_eval_string_from_file_line(
zSchemeInit, SCHEME_INIT_FILE, schemeLine);
SCM_EVAL_CONST("(add-hook! before-error-hook error-source-line)\n"
"(use-modules (ice-9 stack-catch))");
Could you check whether this is the case?
So it is the case. My processing consists of slicing up the input
into a bunch of slivers based on markers. I look at each sliver to
see how to process it. Some are emitted directly, others trigger
internal mechanisms, a few are handed off to a separate server shell
process and finally, if the text starts with an open parenthesis
or a semi-colon (Guile comment marker), then Guile gets it via that call.
Thanks -Bruce