[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: gnetlist backend for xml-bom generation



On Wednesday 25 February 2009 19:22:37 Mike Crowe wrote:

>(define xmlsearchandreplace
>  (lambda (s1 sstring rstring spos)
>        (let ((fpos1 (string-contains s1 sstring spos)))
>                (if fpos1  
>                (begin
>                        (xmlsearchandreplace (string-insert s1 (+ 1
>fpos1) rstring ) sstring rstring (+ fpos1 (string-length rstring)))
>                )
>                (begin
>                        s1
>                )
>                )
>        )
>  )
>)  

I consider this more readable. :P Note the alternative define syntax.

(define (xmlsearchandreplace s1 sstring rstring spos)
  (let ((fpos1 (string-contains s1 sstring spos)))
    (if fpos1
        (xmlsearchandreplace
         (string-insert s1 (+ 1 fpos1) rstring)
         sstring rstring
         (+ fpos1 (string-length rstring)))
        s1)))



                                              Peter

-- 
Peter Brett

Electronic Systems Engineer
Integral Informatics Ltd

Attachment: signature.asc
Description: This is a digitally signed message part.


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user