Ian Price <ianpric...@googlemail.com> 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-quotator
>    '((#\' . "''")
>      (#\~ . "\\~")
>      (#\& . "{ampersand}"))))

Oh, there’s actually something similar in Skribilo (inherited from
Skribe) called ‘make-string-replace’:

  
http://git.savannah.gnu.org/cgit/skribilo.git/tree/src/guile/skribilo/utils/strings.scm#n129
  
http://git.savannah.gnu.org/cgit/skribilo.git/tree/src/guile/skribilo/engine/latex.scm#n52

Thanks,
Ludo’.


Reply via email to