Re: escaping characters

2012-11-02 Thread Ludovic Courtès
Ian Price skribis: > ;; make-char-quotator takes an alist of character + string pairs > ;; the character is the one to escape, and the string its replacement > ;; it returns a function of two arguments, a string to escape, and a > ;; port to write to. > > (define my-weird-escaper > (make-char-q

Re: escaping characters

2012-11-02 Thread Ludovic Courtès
Hi, Kejia柯嘉 skribis: > for an example, when a program reads in a latex source, is there an > escape function that can rewrite all `\' to `\\', `"' to `\"', and so > on? So no, Guile doesn’t have any function related to TeX/LaTeX escaping. Ludo’.

Re: escaping characters

2012-11-02 Thread Ian Price
Kejia$B[I2E(B writes: > hi, > > is there a function that can escape of a string every character which > is an escape character? > > thanks a lot. Oleg Kiselyov has a function called 'make-char-quotator' which, I think, does what you want. Guile does not technically export it, but you can acces

Re: escaping characters

2012-11-01 Thread Noah Lavine
This is related to what ttn said, but I am a bit confused by the request. Normally when you read *in* something like LaTeX source, you convert \\ to \, and similar things. Then when you write *out* LaTeX source, you might convert \ to \\. This is useful if, for instance, you want Guile to automatic

Re: escaping characters

2012-11-01 Thread Thien-Thi Nguyen
() Kejia柯嘉 () Thu, 1 Nov 2012 10:24:52 -0400 for an example, when a program reads in a latex source, is there an escape function that can rewrite all `\' to `\\', `"' to `\"', and so on? This kind of escaping for backslash and double-quote (and other chars, depending on Guile flavor) i

Re: escaping characters

2012-11-01 Thread Kejia柯嘉
hi all, for an example, when a program reads in a latex source, is there an escape function that can rewrite all `\' to `\\', `"' to `\"', and so on? thank you. kejia ☵☯☲ 2012/10/31 Ludovic Courtès : > Hi, > > Kejia柯嘉 skribis: > >> is there a function that can escape of a string every charac

Re: escaping characters

2012-10-31 Thread Ludovic Courtès
Hi, Kejia柯嘉 skribis: > is there a function that can escape of a string every character which > is an escape character? What do you mean by “escape character”? Ludo’.

Re: escaping characters

2012-10-31 Thread nalaginrut
I'm not sure what you mean, any example would be better. Maybe you need 'read-delimited' in the (ice-9 rdelim)? (call-with-input-string "abcd@efg" (lambda (port) (read-delimited "@,/ " port))) ==> abcd Maybe it's not you need, as I said, some example to explain your thought would be better.

escaping characters

2012-10-31 Thread Kejia柯嘉
hi, is there a function that can escape of a string every character which is an escape character? thanks a lot. --- kejia ☵☯☲