From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Jose Roberto B. de A. Monteiro" Newsgroups: gmane.lisp.guile.user Subject: Re: string parsing/preparation for latex Date: Mon, 07 Nov 2005 13:49:01 -0200 Message-ID: <1131378541.3553.13.camel@ariel.sel.eesc.usp.br> References: <20051107145304.0761d3d8@faust> 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 1131378712 4819 80.91.229.2 (7 Nov 2005 15:51:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 7 Nov 2005 15:51:52 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Nov 07 16:51:41 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EZ9FE-00004w-Jr for guile-user@m.gmane.org; Mon, 07 Nov 2005 16:49:16 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EZ9FD-0006WE-Rb for guile-user@m.gmane.org; Mon, 07 Nov 2005 10:49:15 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EZ9F8-0006Va-VR for guile-user@gnu.org; Mon, 07 Nov 2005 10:49:11 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EZ9F5-0006UC-Tn for guile-user@gnu.org; Mon, 07 Nov 2005 10:49:10 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EZ9F5-0006U8-OO for guile-user@gnu.org; Mon, 07 Nov 2005 10:49:07 -0500 Original-Received: from [143.107.235.233] (helo=igbt.sel.eesc.usp.br) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EZ9F5-0007jy-Qk for guile-user@gnu.org; Mon, 07 Nov 2005 10:49:08 -0500 Original-Received: from ariel.sel.eesc.usp.br ([143.107.235.183] ident=mail) by igbt.sel.eesc.usp.br with esmtp (Exim 3.36 #1 (Debian)) id 1EZ9F8-0007cw-00 for ; Mon, 07 Nov 2005 13:49:10 -0200 Original-Received: from betoes by ariel.sel.eesc.usp.br with local (Exim 3.36 #1 (Debian)) id 1EZ9F0-0002y8-00 for ; Mon, 07 Nov 2005 13:49:02 -0200 Original-To: guile-user In-Reply-To: <20051107145304.0761d3d8@faust> X-Mailer: Evolution 2.2.3 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:4938 Archived-At: 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) > )) Because you should have this string: ";; % \\ { } ~ $ & # ^ _", with two backslashes instead of one... the same for " > (texu/prep-str-for-tex ";; % \ { } ~ $ & # ^ _") > ";; \\% \\{ \\} \\~ \\$ \\& \\# \\^ \\_" >=20 > [the \ disapeared rather then being escaped] >=20 > =09 >=20 >=20 > _______________________________________________ > Guile-user mailing list > Guile-user@gnu.org > http://lists.gnu.org/mailman/listinfo/guile-user _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user