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: Wed, 09 Nov 2005 07:24:14 -0600 Message-ID: <4371F87E.1060700@fastmail.fm> References: <20051107145304.0761d3d8@faust> <436FF288.2040803@fastmail.fm> <20051108152615.2b4f6463@faust> <43710DB5.9060706@fastmail.fm> <17265.5098.293871.64950@gargle.gargle.HOWL> 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 1131547459 21387 80.91.229.2 (9 Nov 2005 14:44:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 9 Nov 2005 14:44:19 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Nov 09 15:44:16 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EZr82-0000Jp-Rh for guile-user@m.gmane.org; Wed, 09 Nov 2005 15:40:47 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EZr81-0004XM-Dq for guile-user@m.gmane.org; Wed, 09 Nov 2005 09:40:45 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EZpxE-0002Fy-7y for guile-user@gnu.org; Wed, 09 Nov 2005 08:25:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EZpxA-0002En-2c for guile-user@gnu.org; Wed, 09 Nov 2005 08:25:30 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EZpwY-00023x-FL for guile-user@gnu.org; Wed, 09 Nov 2005 08:24:51 -0500 Original-Received: from [131.225.111.11] (helo=mailgw1.fnal.gov) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EZpwY-00018S-FW for guile-user@gnu.org; Wed, 09 Nov 2005 08:24:50 -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 <0IPO00EMNVW7UW@mailgw1.fnal.gov> for guile-user@gnu.org; Wed, 09 Nov 2005 07:24:49 -0600 (CST) Original-Received: from mailgw2.fnal.gov ([131.225.111.12]) by mailav1.fnal.gov (SAVSMTP 3.1.7.47) with SMTP id M2005110907244826698 for ; Wed, 09 Nov 2005 07:24:48 -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 <0IPO00D01VIDF7@mailgw2.fnal.gov> (original mail from j85wilson@fastmail.fm) for guile-user@gnu.org; Wed, 09 Nov 2005 07:24:49 -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 <0IPO00MLYVWEC1@mailgw2.fnal.gov> for guile-user@gnu.org; Wed, 09 Nov 2005 07:24:48 -0600 (CST) In-reply-to: <17265.5098.293871.64950@gargle.gargle.HOWL> 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:4950 Archived-At: Hi Klaus, scheme->LaTeX would have to be a macro, then it receives its arguments before they are evaluated. Unless of course I'm mistaken about the nature of macros. (I'm still relatively new to the idea.) eg (simple example, its 7am here and I got to sleep at 2.): (define-macro (+->LaTeX +expr) (string-append (number->string (cadr +expr)) "+" (number->string (caddr +expr)))) (+->LaTeX (+ 9 15)) => "9+15" Unless I've screwed something up in my sleepiness, but I just tested it and yeah that seems to work as far as a proof of concept goes. Guile version 1.6.4, I don't know if things have changed in unstable version. Regards, Jon klaus schilling wrote: > Jon Wilson writes: > > > > (scheme->LaTeX (+ 7 (/ 18 5))) > > => > > "7 + \frac{18}{5}" > > > shouldn't the argument be quoted? otherwise it will be evaluated > straight to 10.6 (or whatever style of representation has been > chosen for rationals, the unstable versions for guile seem to > provide for more possibilities) > > Klaus Schilling _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user