From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: RFD: add an interface scm_c_eval_string_from_file_line Date: Mon, 22 Sep 2008 22:09:55 +0200 Message-ID: <8763oo6iy4.fsf@gnu.org> References: <668c430c0809220858p1382a21bx702193f7a498ff13@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1222114221 31422 80.91.229.12 (22 Sep 2008 20:10:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 22 Sep 2008 20:10:21 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Sep 22 22:11:18 2008 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Khrka-0003xP-ML for guile-devel@m.gmane.org; Mon, 22 Sep 2008 22:11:16 +0200 Original-Received: from localhost ([127.0.0.1]:54257 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KhrjY-0002Yo-PW for guile-devel@m.gmane.org; Mon, 22 Sep 2008 16:10:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KhrjW-0002Y7-63 for guile-devel@gnu.org; Mon, 22 Sep 2008 16:10:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KhrjU-0002X6-BM for guile-devel@gnu.org; Mon, 22 Sep 2008 16:10:09 -0400 Original-Received: from [199.232.76.173] (port=53861 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KhrjU-0002Wx-6f for guile-devel@gnu.org; Mon, 22 Sep 2008 16:10:08 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:40195 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KhrjT-0004Qm-OY for guile-devel@gnu.org; Mon, 22 Sep 2008 16:10:08 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KhrjR-0007mY-Kr for guile-devel@gnu.org; Mon, 22 Sep 2008 20:10:05 +0000 Original-Received: from reverse-83.fdn.fr ([80.67.176.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 22 Sep 2008 20:10:05 +0000 Original-Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 22 Sep 2008 20:10:05 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 34 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: reverse-83.fdn.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 1 =?iso-8859-1?Q?Vend=E9miaire?= an 217 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: i686-pc-linux-gnu User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) Cancel-Lock: sha1:mEUbIHblJlBqyl6YNSE0x7cn958= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:7737 Archived-At: Hi, "Bruce Korb" writes: > On Mon, Sep 22, 2008 at 8:16 AM, Ludovic Courtès wrote: >>> SCM expr = scm_makfrom0str( pzExpr ); >> >> That's deprecated as of 1.8, use `scm_from_locale_string ()'. > > This is used iff Guile antedates 1.6. I guess that can be junked now? Yes. >> Anyway, why not just use `scm_c_eval_string ()'? It'd be really safer >> than "rolling your own". > > Because the strings are extracted from large text files and it is important > that the error message reveal the correct file and line number. It is > precisely because of the issues with cruft like using internal Guile > structures that I'd be so extremely happy to (finally) see a a proper export of: > scm_c_eval_string_from_file_line(SCM string, SCM file, SCM line) > Then for GUILE_VERSION >= 109000 I could just #define my variation > to the Proper Call. :) Hmm, the port "API" is really one of the least pleasant parts of Guile. :-) The issue, as you notice, is that it exposes a lot of internals and is quite inconvenient. Actually, now that I read it again, your code for GUILE_VERSION >= 107000 doesn't look that terrific---it's the compatibility code for 1.6 that's quite hard to read. Thanks, Ludo'.