[Top][All Lists]

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

Re: I don't want to maintain this

From: Bruce Korb
Subject: Re: I don't want to maintain this
Date: Tue, 29 Nov 2005 12:14:36 -0800
User-agent: KMail/1.7.1

On Tuesday 29 November 2005 12:16 am, Ludovic Courtès wrote:
> Hi,
> Bruce Korb <address@hidden> writes:
> > Grumble, grumble.  Anyway, this belongs in your code.  We argued about this
> > before and someone said, "well, you could do it in any of several ways,
> > so we won't do it at all."  This function is entirely equivalent to
> > "scm_c_eval_string" except that error results show file name and line 
> > number.
> Sorry if I'm just re-stating what you were already answered: Can't you
> implement this as a small Scheme procedure?  Something along the lines
> of:

Hi Ludovic,

*I* certainly cannot.  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))

and use it thus:

   sprintf( buf, fmt, filename, linenum, script );
   result = scm_c_eval_string( buf );

Would that work?

Your help is _surely_  appreciated!!  Thank you.

Kind regards, Bruce

reply via email to

[Prev in Thread] Current Thread [Next in Thread]