On 14.05.2012 12:34, David Kastrup wrote:
Jan-Peter Voigt<[email protected]>  writes:

Hello  Harm and list,
Could you try _not_ posting in HTML?  This mail had both a plain text as
well as an HTML-specified part, and both rendered awfully here.  If you
send just as plain text, chances are that you see what you are actually
sending.
ups, sorry! It was the last thunderbird update, or whatever ...
\version "2.15.38"

% predicate for a number or a list of numbers
#(define (number-or-list? v)

(or (number? v)

(and

(list? v)

(eval `(and ,@(map (lambda (x)`(number? ,x)) v))(interaction-environment))

)))
What is the crazy idea with using eval?  Why don't you use

(every number? v) here?
... because I sometimes don't see the obvious ... ;-) thank you!
I sometimes like to change only the inner and sometimes also the outer ones, so I have a number or a pair of numbers and a predicate, that looks for one of them. But I thought, it is easier to explain just one case ... still I could have used (every):
--snip--

(define (number-or-list? v)

(or (number? v)

(number-pair? v)

(and (list? v)
(every (lambda (x) (or (number? x)(number-pair? x))) v)

)))

--snip--

This might still be ugly, but it works for me - so its OK ;-)

Cheers, Jan-Peter


_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to