Hi,
As you know , I have started coding the ly-> xml in scheme,
but as i want to make the code easier to read, I started to create a list
of callback to retrieve information for example
so I wrote this (for example):
;; once you retrived the good object you just have to extract its value
;; functions to retrieve the value of duration/step/octave
(define function-value-list
(('duration . ((lambda(x) (ly:duration-log x))))
('step . ((lambda(x) (ly:pitch-notename x))))
('test . ((lambda(x) (begin (display "salut :")
(display x) (display ".\n")))))
('octave . ((lambda(x) (ly:pitch-octave x))))))
;; return false if value is not found
(define (get_value music name )
(if (assq name function-value-list)
(let (fun (car(assq name function-value-list)))
(fun music))
(#f)))
however , it does not seem to work , because is always says Wrong type
to apply: duration
even though I never called the function yet... if i am executing it
inside a lilypond file
i get this Unbound variable: function-value-list
so I begin to think it is impossible to create a list containing, is it ?
if so, i will have to create each function one by one, so it would be
longer and more difficult to edit ...
Thanks very much
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel