unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: "Jose Roberto B. de A. Monteiro" <betoes@sel.eesc.usp.br>
Subject: Re: string parsing/preparation for latex
Date: Mon, 07 Nov 2005 13:49:01 -0200	[thread overview]
Message-ID: <1131378541.3553.13.camel@ariel.sel.eesc.usp.br> (raw)
In-Reply-To: <20051107145304.0761d3d8@faust>

Em Seg, 2005-11-07 às 14:53 +0100, David Pirotte escreveu:
> 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)
> 	    ))

Because you should have this string: ";; % \\ { } ~ $ & # ^ _", with two
backslashes instead of one... the same for "

> 	(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


  reply	other threads:[~2005-11-07 15:49 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 [this message]
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
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=1131378541.3553.13.camel@ariel.sel.eesc.usp.br \
    --to=betoes@sel.eesc.usp.br \
    /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).