From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jon Wilson Newsgroups: gmane.lisp.guile.user Subject: Re: string parsing/preparation for latex Date: Mon, 07 Nov 2005 18:34:16 -0600 Message-ID: <436FF288.2040803@fastmail.fm> References: <20051107145304.0761d3d8@faust> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7BIT X-Trace: sea.gmane.org 1131410156 13501 80.91.229.2 (8 Nov 2005 00:35:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 8 Nov 2005 00:35:56 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Nov 08 01:35:46 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EZHRk-000076-Bf for guile-user@m.gmane.org; Tue, 08 Nov 2005 01:34:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EZHRj-0000kq-9K for guile-user@m.gmane.org; Mon, 07 Nov 2005 19:34:43 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EZHRR-0000kM-2Q for guile-user@gnu.org; Mon, 07 Nov 2005 19:34:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EZHRO-0000k9-Ty for guile-user@gnu.org; Mon, 07 Nov 2005 19:34:24 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EZHRK-0000k6-Rp for guile-user@gnu.org; Mon, 07 Nov 2005 19:34:21 -0500 Original-Received: from [131.225.111.11] (helo=mailgw1.fnal.gov) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EZHRK-0000yW-WD for guile-user@gnu.org; Mon, 07 Nov 2005 19:34:19 -0500 Original-Received: from mailav1.fnal.gov (mailav1.fnal.gov [131.225.111.18]) by mailgw1.fnal.gov (iPlanet Messaging Server 5.2 HotFix 2.06 (built Mar 28 2005)) with SMTP id <0IPM001WS1KH2B@mailgw1.fnal.gov> for guile-user@gnu.org; Mon, 07 Nov 2005 18:34:17 -0600 (CST) Original-Received: from mailgw2.fnal.gov ([131.225.111.12]) by mailav1.fnal.gov (SAVSMTP 3.1.7.47) with SMTP id M2005110718341717616 for ; Mon, 07 Nov 2005 18:34:17 -0600 Original-Received: from conversion-daemon.mailgw2.fnal.gov by mailgw2.fnal.gov (iPlanet Messaging Server 5.2 HotFix 2.06 (built Mar 28 2005)) id <0IPM00F011A514@mailgw2.fnal.gov> (original mail from j85wilson@fastmail.fm) for guile-user@gnu.org; Mon, 07 Nov 2005 18:34:17 -0600 (CST) Original-Received: from [129.62.118.83] by mailgw2.fnal.gov (iPlanet Messaging Server 5.2 HotFix 2.06 (built Mar 28 2005)) with ESMTPSA id <0IPM00JBW1L5C8@mailgw2.fnal.gov> for guile-user@gnu.org; Mon, 07 Nov 2005 18:34:17 -0600 (CST) In-reply-to: <20051107145304.0761d3d8@faust> Original-To: guile-user X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050324) 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:4939 Archived-At: Hi David, This is interesting... Just for the sake of my curiousity, could you describe what project this is for? Regards, Jon David Pirotte wrote: > does anyone understands why this does not return the expected result > > (define *texu/reserved-characters* > ;; % \ { } ~ $ & # ^ _ > '( > #\% ;; comments > #\\ ;; command(follows by a space) > #\{ ;; definition of treatment block(main_arg) > #\} > #\~ ;; indivisible space > #\$ ;; mathematical mode > #\& ;; tabulation ... > #\# ;; symbol of parameter zone > #\^ ;; exponent > #\_ ;; index > ) > ) > > (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) > )) > > (texu/prep-str-for-tex ";; % \ { } ~ $ & # ^ _") > ";; \\% \\{ \\} \\~ \\$ \\& \\# \\^ \\_" > > [the \ disapeared rather then being escaped] > > > > > _______________________________________________ > 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