lilypond-user
[Top][All Lists]
Advanced

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

Re: Attaching an alist to a grob


From: Urs Liska
Subject: Re: Attaching an alist to a grob
Date: Wed, 14 Jan 2015 11:29:16 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.3.0


Am 14.01.2015 um 11:18 schrieb Mattes:
Am Mittwoch, 14. Januar 2015 09:42 CET, Urs Liska <address@hidden> schrieb:
Yes, I made some surprising progress with Scheme recently. I didn't even
get stuck in the ands and parens in the actual predicate I wrote

#(define (annotation? obj)
     (and
      (and (list? obj)
           (every pair? obj))
      (and (if (assoc-ref obj "type") #t #f)
           (if (assoc-ref obj "location") #t #f))))
Proper indentation helps ;-)
But why so contrived? Your code is equivalent to:

#(define (annotation? obj)
    (and
     (list? obj)
     (every pair? obj)
     (if (assoc-ref obj "type") #t #f)
     (if (assoc-ref obj "location") #t #f)))

HTH Ralf Mattes

Thanks, this is of course better.
sorting out nested conditionals has never been my strongest point ;-)

Urs



reply via email to

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