From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludovic.courtes@laas.fr (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: I don't want to maintain this Date: Wed, 30 Nov 2005 14:46:14 +0100 Organization: LAAS-CNRS Message-ID: <8764qa6yft.fsf@laas.fr> References: <200511272025.32395.bruce.korb@gmail.com> <200511291214.37104.bruce.korb@gmail.com> <87mzjmfs1q.fsf@laas.fr> <200511300430.08897.bruce.korb@gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1133371487 3189 80.91.229.2 (30 Nov 2005 17:24:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 30 Nov 2005 17:24:47 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Nov 30 18:24:45 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EhUyx-0001bB-Cs for guile-devel@m.gmane.org; Wed, 30 Nov 2005 17:38:59 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EhUyv-0000Eh-Oq for guile-devel@m.gmane.org; Wed, 30 Nov 2005 11:38:57 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EhSIK-0000Qm-Gb for guile-devel@gnu.org; Wed, 30 Nov 2005 08:46:49 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EhSIF-0000OI-Ta for guile-devel@gnu.org; Wed, 30 Nov 2005 08:46:46 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EhSIF-0000OB-PC for guile-devel@gnu.org; Wed, 30 Nov 2005 08:46:43 -0500 Original-Received: from [140.93.0.15] (helo=laas.laas.fr) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EhSIF-0000Yq-9F for guile-devel@gnu.org; Wed, 30 Nov 2005 08:46:43 -0500 Original-Received: by laas.laas.fr (8.13.1/8.13.4) with SMTP id jAUDkZME018689; Wed, 30 Nov 2005 14:46:36 +0100 (CET) Original-To: Bruce Korb X-URL: http://www.laas.fr/~lcourtes/ X-Revolutionary-Date: 10 Frimaire an 214 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEB1F5364 X-PGP-Key: http://www.laas.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: powerpc-unknown-linux-gnu Mail-Followup-To: Bruce Korb , guile-devel@gnu.org In-Reply-To: <200511300430.08897.bruce.korb@gmail.com> (Bruce Korb's message of "Wed, 30 Nov 2005 04:30:08 -0800") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) X-Spam-Score: 0 () X-Scanned-By: MIMEDefang at CNRS-LAAS 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:5430 Archived-At: Bruce Korb writes: > 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". Oh, but things are different here: this is Scheme! ;-) Just out of curiosity: why are you writing Scheme if you don't like it? > 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.) While you're at reading Scheme code from a file, why not use Scheme construct (be it from Scheme of C code) whose purpose are exactly that? Consider the following excerpt: (with-input-from-file "chbouib.scm" read) This will read a single balanced expression (S-exp) from "chbouib.scm" and return it[0]. Additionally, Guile does something interesting: it attaches to that returned S-exp information about its original location. IOW, you can then use the source property API[1] with that S-exp to know where it came from (file name, line number, etc.). It seems to be exactly the kind of feature you are looking for, isn't it? What you are describing (reading a file into memory, asking Guile to evaluate its content as a string, adding location information to it) is just what Guile's `read' already does. Thanks, Ludovic. [0] http://www.gnu.org/software/guile/docs/guile-ref/Scheme-Read.html#Scheme%20Read [1] http://www.gnu.org/software/guile/docs/guile-ref/Procedure-Properties.html#Procedure%20Properties _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel