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