From: Bruce Korb <bruce.korb@gmail.com>
Cc: guile-devel@gnu.org
Subject: Re: I don't want to maintain this
Date: Wed, 30 Nov 2005 04:30:08 -0800 [thread overview]
Message-ID: <200511300430.08897.bruce.korb@gmail.com> (raw)
In-Reply-To: <87mzjmfs1q.fsf@laas.fr>
On Wednesday 30 November 2005 12:39 am, Ludovic Courtès wrote:
> Hi Bruce,
>
> Bruce Korb <bruce.korb@gmail.com> writes:
>
> > *I* certainly cannot.
>
> Do you mean that you don't *want* to, or that this is not possible?
Well, okay, I don't find the stuff obvious. With effort, I'm sure
I could puzzle it out. I have never found Lisp to be inherently
"obvious".
> > 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?
I extract the scheme code from a file. Now, I have a string in memory
and I want it eval-ed. If I was reading your suggestion correctly,
I would need to write that string to a real file. I want to avoid
that. I want to hand that string, from memory, to Guile and tell
Guile, "This string came from file XXX on line NNN." (That is what
the ag_scm_c_eval_string_from_file_line() does.)
> 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"));
Or this?
SCM body = scm_from_locale_string (extracted_text);
SCM file = scm_from_locale_string (current_input_file);
SCM line = scm_from_<integer?> (line_num);
return scm_call_3 (eval_proc, body, file, line);
Obviously, ``eval-from-file'' has to be reformulated to eval "body" instead of
reading input from a file and it must set the file name and line number
from the passed in arguments, but something like this ought to be workable,
yes? Sorry for being dense, but just how to formulate the "eval-from-xxx" thing
isn't real obvious to me. Thank you for your help & patience. Regards, Bruce
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2005-11-30 12:30 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-28 4:25 I don't want to maintain this Bruce Korb
2005-11-29 8:16 ` Ludovic Courtès
2005-11-29 20:14 ` Bruce Korb
2005-11-30 8:39 ` Ludovic Courtès
2005-11-30 12:30 ` Bruce Korb [this message]
2005-11-30 13:46 ` Ludovic Courtès
2005-11-30 14:00 ` Bruce Korb
2005-11-30 14:44 ` Getting source location information Ludovic Courtès
2005-11-30 15:30 ` Bruce Korb
2005-11-30 16:04 ` Ludovic Courtès
2005-11-30 16:58 ` Bruce Korb
2005-11-30 17:39 ` Ludovic Courtès
2005-12-01 12:19 ` Ludovic Courtès
2005-11-30 19:00 ` Rob Browning
2005-11-30 20:53 ` Bruce Korb
2005-11-30 22:35 ` Rob Browning
2005-11-30 23:30 ` Bruce Korb
2005-12-14 21:54 ` Kevin Ryde
2005-11-30 23:45 ` Han-Wen Nienhuys
2005-12-01 0:30 ` I don't want to maintain this Kevin Ryde
2005-12-01 0:38 ` Kevin Ryde
2005-12-07 0:36 ` Marius Vollmer
-- strict thread matches above, loose matches on Subject: below --
2005-11-28 4:27 Bruce Korb
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200511300430.08897.bruce.korb@gmail.com \
--to=bruce.korb@gmail.com \
--cc=guile-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).