(lambda (record) ((record-predicate ,record) record)))
(set! ,$make-record
(lambda* (#:key ,@slots)
- ((record-constructor ,record) ,@(map car slots*))))
+ ((record-constructor ,record) ,@(map car slots*))))
(set! ,$copy-record
(lambda (record)
- (,$make-record ,@(apply
- append
- (map (lambda (slot)
- (list (symbol->keyword slot)
- (list (make-symbol reader-format slot) 'record)))
- (map car slots*))))))
+ (,$make-record ,@(append-map
+ (lambda (slot)
+ (list (symbol->keyword slot)
+ (list (make-symbol reader-format slot) 'record)))
+ (map car slots*)))))
,@(map (lambda (s)
`(set! ,(make-symbol reader-format (car s))
(record-accessor ,record (quote ,(car s)))))
(define-public (music-elements music)
"Return list of all @var{music}'s top-level children."
(let ((elt (ly:music-property music 'element))
- (elts (append
- (ly:music-property music 'articulations)
- (ly:music-property music 'elements))))
- (if (not (null? elt))
- (cons elt elts)
- elts)))
+ (elts (ly:music-property music 'elements))
+ (arts (ly:music-property music 'articulations)))
+ (if (pair? arts)
+ (set! elts (append elts arts)))
+ (if (null? elt)
+ elts
+ (cons elt elts))))
(define-public (find-child music predicate)
"Find the first node in @var{music} that satisfies @var{predicate}."
(let* ((elt (car queue))
(stop (function elt)))
(process-music (if (boolean? stop)
- (if stop
- (cdr queue)
- (append (music-elements elt) (cdr queue)))
- ((if (cheap-list? stop) append cons)
- stop (cdr queue)))))))
+ (if stop
+ (cdr queue)
+ (append (music-elements elt) (cdr queue)))
+ ((if (cheap-list? stop) append cons)
+ stop (cdr queue)))))))
(process-music (list music)))