From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marius Vollmer Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] for strports.c: scm_c_eval_string_from_file_line Date: 01 Jun 2003 22:00:31 +0200 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87el2dlg9s.fsf@zagadka.ping.de> References: <3ECFDA48.309D0F5@veritas.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1054497772 17983 80.91.224.249 (1 Jun 2003 20:02:52 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 1 Jun 2003 20:02:52 +0000 (UTC) Cc: guile development Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Jun 01 22:02:50 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19MZ26-0004dc-00 for ; Sun, 01 Jun 2003 22:02:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19MZ3g-0005K2-Pt for guile-devel@m.gmane.org; Sun, 01 Jun 2003 16:04:00 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19MZ32-00054T-Vp for guile-devel@gnu.org; Sun, 01 Jun 2003 16:03:20 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19MZ1o-00044P-SX for guile-devel@gnu.org; Sun, 01 Jun 2003 16:02:05 -0400 Original-Received: from mail.dokom.net ([195.253.8.218]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19MZ1H-00041I-DC for guile-devel@gnu.org; Sun, 01 Jun 2003 16:01:31 -0400 Original-Received: from dialin.speedway43.dip132.dokom.de ([195.138.43.132] helo=zagadka.ping.de) by mail.dokom.net with smtp (Exim 3.36 #3) id 19MZ39-0003JG-00 for guile-devel@gnu.org; Sun, 01 Jun 2003 22:03:27 +0200 Original-Received: (qmail 20188 invoked by uid 1000); 1 Jun 2003 20:00:31 -0000 Original-To: Bruce Korb In-Reply-To: <3ECFDA48.309D0F5@veritas.com> Original-Lines: 38 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2468 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2468 Bruce Korb writes: > 2003-05-24 Bruce Korb > > * guile-core/libguile/strports.c(scm_c_eval_string_from_file_line): > new procedure. Facilitate error messages for applications that > extract scheme code from their input files. Hmm, I'm not sure whether we should provide such a function as a ready made unit. Evaluation from strings (maybe with embedded new lines, maybe more than one string, etc) while maintaining the line number, the current module, etc, might come in several variations, I think. We should provide the building blocks so that people can easily implement what they want cleanly so that scm_c_eval_string_from_file_line is very easy to implement. What you can do right now is, for example (and untested, sorry): void scm_c_primitive_load_from_string (const char *str, const char *filename, int line) { SCM port, exp; port = scm_open_input_string (scm_str2string (str)); scm_set_port_file_name_x (port, scm_str2string (filename)); scm_set_port_line_x (port, scm_int2num (line)); while (!SCM_EOF_OBJECT_P (exp = scm_read (port))) scm_primitive_eval_x (exp); } I think this quite straightforward, no? But we might want to offer it ready-made, anyway. Opinions? -- GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel