From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Pirotte Newsgroups: gmane.lisp.guile.user Subject: Re: string parsing/preparation for latex Date: Tue, 8 Nov 2005 15:52:12 +0100 Organization: Alto Air Services [http://www.altosw.be/aas/] Message-ID: <20051108155212.1f7f04c7@faust> References: <20051107145304.0761d3d8@faust> <1131378541.3553.13.camel@ariel.sel.eesc.usp.br> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1131464094 972 80.91.229.2 (8 Nov 2005 15:34:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 8 Nov 2005 15:34:54 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Nov 08 16:34:50 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EZVPr-0000Hw-W2 for guile-user@m.gmane.org; Tue, 08 Nov 2005 16:29:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EZVPr-0007en-4O for guile-user@m.gmane.org; Tue, 08 Nov 2005 10:29:43 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EZUpo-0007c8-8W for guile-user@gnu.org; Tue, 08 Nov 2005 09:52:29 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EZUpm-0007aH-D2 for guile-user@gnu.org; Tue, 08 Nov 2005 09:52:27 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EZUpg-0007Zv-Uv for guile-user@gnu.org; Tue, 08 Nov 2005 09:52:21 -0500 Original-Received: from [193.74.71.22] (helo=guri.is.scarlet.be) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EZUph-0008W9-2i for guile-user@gnu.org; Tue, 08 Nov 2005 09:52:21 -0500 Original-Received: from (ip-213-49-108-21.dsl.scarlet.be [213.49.108.21]) by guri.is.scarlet.be with ESMTP id jA8EqI725670 for ; Tue, 8 Nov 2005 15:52:18 +0100 Original-To: guile-user@gnu.org In-Reply-To: <1131378541.3553.13.camel@ariel.sel.eesc.usp.br> X-Mailer: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i486-pc-linux-gnu) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:4943 Archived-At: On Mon, 07 Nov 2005 13:49:01 -0200 "Jose Roberto B. de A. Monteiro" wrote: > Em Seg, 2005-11-07 =E0s 14:53 +0100, David Pirotte escreveu: > > does anyone understands why this does not return the expected result > >=20 > > (define *texu/reserved-characters* > > ;; % \ { } ~ $ & # ^ _ > > '( > > #\% ;; comments > > #\\ ;; command(follows by a space) > > #\{ ;; definition of treatment block(main_arg) > > #\} =09 > > #\~ ;; indivisible space > > #\$ ;; mathematical mode=20 > > #\& ;; tabulation ... > > #\# ;; symbol of parameter zone > > #\^ ;; exponent > > #\_ ;; index > > ) > > ) > >=20 > > (define (texu/prep-str-for-tex str) > > (let ((str-lst (string->list str)) > > (result (list))) > > (for-each (lambda (chr) > > (if (member chr *texu/reserved-characters*) > > (set! result (cons chr (cons #\\ result))) > > (set! result (cons chr result)))) > > str-lst) > > (reverse-list->string result) > > )) >=20 > Because you should have this string: ";; % \\ { } ~ $ & # ^ _", with two > backslashes instead of one... the same for " but that is not possible, because the string (here simulated) is a user typ= ed in string (through a gtk interface programmed in guile-gnome) upon which I have no c= ontrol.=20 I precisly wish to parse it to create a .tex file later processed by latex = ... _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user