From: Jon Wilson <j85wilson@fastmail.fm>
Subject: Re: string parsing/preparation for latex
Date: Wed, 09 Nov 2005 07:24:14 -0600 [thread overview]
Message-ID: <4371F87E.1060700@fastmail.fm> (raw)
In-Reply-To: <17265.5098.293871.64950@gargle.gargle.HOWL>
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
next prev parent reply other threads:[~2005-11-09 13:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-07 13:53 string parsing/preparation for latex David Pirotte
2005-11-07 15:49 ` Jose Roberto B. de A. Monteiro
2005-11-08 14:52 ` David Pirotte
2005-11-08 16:35 ` Jose Roberto B. de A. Monteiro
2005-11-08 16:56 ` Stephen Compall
2005-11-08 0:34 ` Jon Wilson
2005-11-08 14:26 ` David Pirotte
2005-11-08 20:42 ` Jon Wilson
2005-11-08 21:08 ` klaus schilling
2005-11-09 13:24 ` Jon Wilson [this message]
2005-11-14 3:17 ` Stephen Compall
2005-11-15 1:50 ` Jon Wilson
2005-11-16 2:52 ` Stephen Compall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4371F87E.1060700@fastmail.fm \
--to=j85wilson@fastmail.fm \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).