Hi Bruce,
Bruce Korb [EMAIL PROTECTED] writes:
*I* certainly cannot.
Do you mean that you don't *want* to, or that this is not possible?
The point is that writing Scheme code will always be easier than writing
C code, and maintaining it will be even more easier.
And I do not understand the usage of the file
argument. What I am doing is extracting Scheme code from an encompassing
template and handing it off for evaluation. My program is reading the
file, not Guile. When I hand off the the string for evaluation, I hand
it to that ugly thing that I do not want to maintain. I do this in
exactly the same way as one would with scm_c_eval_string, except I have
the additional parameters file name and line number. Perhaps I could
wrap my strings in something like this:
char* fmt =
(read-enable 'positions)
(format #t \evaluating `~a' from ~a:~a:~a~%%\
sexp (port-filename (current-input-port))
(source-property sexp \%s\)
(source-property sexp %d))
(begin
%s
);
and use it thus:
sprintf( buf, fmt, filename, linenum, script );
result = scm_c_eval_string( buf );
Would that work?
That might work, but that's ugly. Are you evaluating reading a file
and evaluating it from C code?
Even if this is the case, nothing prevents you from writing your own
read/eval function in Scheme (along the lines of what I posted earlier)
and using it from C:
eval_proc = scm_c_eval_string (eval-from-file);
result = scm_call_1 (eval_proc, scm_from_locale_string (the-file.scm));
Hope this helps,
Ludovic.
___
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel