From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen Compall" Newsgroups: gmane.lisp.guile.user Subject: Re: string parsing/preparation for latex Date: Tue, 8 Nov 2005 10:56:08 -0600 Message-ID: References: <20051108155212.1f7f04c7@faust> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1131469594 21730 80.91.229.2 (8 Nov 2005 17:06:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 8 Nov 2005 17:06:34 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Nov 08 18:06:23 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EZWoQ-0003XE-Fd for guile-user@m.gmane.org; Tue, 08 Nov 2005 17:59:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EZWoQ-0001FM-2z for guile-user@m.gmane.org; Tue, 08 Nov 2005 11:59:10 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EZWnL-0000tb-Pi for guile-user@gnu.org; Tue, 08 Nov 2005 11:58:04 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EZWnJ-0000sF-Sy for guile-user@gnu.org; Tue, 08 Nov 2005 11:58:03 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EZWnJ-0000s1-MF for guile-user@gnu.org; Tue, 08 Nov 2005 11:58:01 -0500 Original-Received: from [192.195.225.72] (helo=uesmtp.evansville.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EZWnJ-0004oN-QY for guile-user@gnu.org; Tue, 08 Nov 2005 11:58:01 -0500 Original-Received: from uemail.evansville.edu ([10.5.0.16]) by uesmtp.evansville.edu with Microsoft SMTPSVC(6.0.3790.1830); Tue, 8 Nov 2005 10:56:13 -0600 Original-Received: from kc267pc8 ([10.10.0.142]) by uemail.evansville.edu with Microsoft SMTPSVC(6.0.3790.1830); Tue, 8 Nov 2005 10:56:11 -0600 Original-To: "'David Pirotte'" , X-Mailer: Microsoft Office Outlook, Build 11.0.6353 In-Reply-To: <20051108155212.1f7f04c7@faust> Thread-Index: AcXkeQB44IdeTHrFQae4rsqWUbgLCgACu1Kg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-OriginalArrivalTime: 08 Nov 2005 16:56:11.0752 (UTC) FILETIME=[5299C680:01C5E485] 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:4945 Archived-At: David Pirotte writes: > but that is not possible, because the string (here simulated) > is a user typed in string (through a gtk interface > programmed in guile-gnome) upon which I have no control. > I precisly wish to parse it to create a .tex file later > processed by latex ... If you expect users to type in strings as Scheme expressions, I would think you'd have no problem expecting them to know that backslashes have to be escaped. In other words, I think you're confusing reading strings, in the sense of the `read' function for Scheme expressions, and reading raw character data *into* strings, which is the usual practice when grabbing GUI form fields, unless of course the form field is supposed to contain a Scheme expression. guile> (use-modules (ice-9 rdelim)) guile> (texu/prep-str-for-tex (read-line)) ;; % \ { } ~ $ & # ^ _ => ";; \\% \\\\ \\{ \\} \\~ \\$ \\& \\# \\^ \\_" guile> (begin (display (texu/prep-str-for-tex (read-line))) (newline)) ;; % \ { } ~ $ & # ^ _ -| ;; \% \\ \{ \} \~ \$ \& \# \^ \_ Where guile> is a prompt, => means a return value, -| means printed line, all else is typed. -- Stephen Compall http://scompall.nocandysoftware.com/blog _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user