lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lilypond/scm to-xml.scm


From: Han-Wen Nienhuys
Subject: lilypond/scm to-xml.scm
Date: Mon, 30 Sep 2002 10:40:19 +0200

address@hidden writes:
> CVSROOT:      /cvsroot/lilypond
> Module name:  lilypond
> Changes by:   Jan Nieuwenhuizen <address@hidden>      02/09/29 19:52:47
> 
> Modified files:
>       scm            : to-xml.scm 
> 
> Log message:
>       Fixes.
> 
> CVSWeb URLs:
> http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/to-xml.scm.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
> 
> Patches:
> Index: lilypond/scm/to-xml.scm
> diff -c lilypond/scm/to-xml.scm:1.3 lilypond/scm/to-xml.scm:1.4
> *** lilypond/scm/to-xml.scm:1.3       Sun Sep 29 19:18:55 2002
> --- lilypond/scm/to-xml.scm   Sun Sep 29 19:52:47 2002
> ***************
> *** 99,104 ****
> --- 99,110 ----
>   (define (re-sub re to string)
>     (regexp-substitute/global #f re string 'pre to 'post))
>   
> + (define (re-sub-alist string alist)
> +   (re-sub (caar alist) (cdar alist)
> +       (if (pair? (cdr alist))
> +           (re-sub-alist string (cdr alist))
> +           string)))
> + 

Korte opm.: crasht op lege lijst. Standaard  partoon voor lijst
functies:

 (define (func l string)
   (if (null? l)
       string
       (func (cdr l) (re-sub-pair (car l)))))

misschien ook renamen naar re-sub-many ?  alist is meer soort
functie/dict gedachte, waarbij de car een key is.

Dit alles natuurlijk modulo "geen nieuws is goed nieuws." Eens kijken
of iemand iets met XML gaat doen.

-- 

Han-Wen Nienhuys   |   address@hidden    | http://www.cs.uu.nl/~hanwen/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]