Tao Cumplido wrote:
> #(define (super-string s)
> (if (string? s)
> (let ((n (string-length s))
> (s2 ""))
> (do ((i 0 (1+ i))) ((= i n))
> (let* ((c (cdr (assoc (string-ref s i) super-ref char=?)))
> (l (string-length c)))
> (do ((a 0 (1+ a))) ((= a l))
> (set! s2 (string-append s2 (string (string-ref c a)))))))
> s2)))
>
> It's a little chaotic but it works.
> A minimal sample of (super-ref) could be:
>
> #(define super-ref
> (list
> (cons #\A "Ø")
> ))
Nice work! Here's one way to simplify it.
- Mark
(define super-ref
(list
(cons #\A "Ø")
))
(define (char->special x)
(assoc-ref super-ref x))
(define (super-string str)
(let ((new ""))
(string-for-each
(lambda (x) (set! new (string-append new (char->special x))))
str)
new))
_______________________________________________
lilypond-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-user