;;;; This file is part of LilyPond, the GNU music typesetter.
;;;;
-;;;; Copyright (C) 1998--2010 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; Copyright (C) 1998--2011 Jan Nieuwenhuizen <janneke@gnu.org>
;;;; Han-Wen Nienhuys <hanwen@xs4all.nl>
;;;;
;;;; LilyPond is free software: you can redistribute it and/or modify
(map-alist-vals func (cdr list)))))
(define (map-alist-keys func list)
- "map FUNC over the keys of an alist LIST, leaving the vals. "
+ "map FUNC over the keys of an alist LIST, leaving the vals."
(if (null? list)
'()
(cons (cons (func (caar list)) (cdar list))
(helper lst 0))
(define-public (count-list lst)
- "Given lst (E1 E2 .. ) return ((E1 . 1) (E2 . 2) ... ) "
+ "Given lst (E1 E2 .. ), return ((E1 . 1) (E2 . 2) ... )."
(define (helper l acc count)
(if (pair? l)
(lset-difference eq? a b))
(define-public (uniq-list lst)
- "Uniq LST, assuming that it is sorted. Uses equal? for comparisons."
+ "Uniq LST, assuming that it is sorted. Uses equal? for comparisons."
(reverse!
(fold (lambda (x acc)
(define (split-at-predicate pred lst)
"Split LST into two lists at the first element that returns #f for
- (PRED previous_element element). Return the two parts as a pair.
+ (PRED previous_element element). Return the two parts as a pair.
Example: (split-at-predicate < '(1 2 3 2 1)) ==> ((1 2 3) . (2 1))"
(if (null? lst)
(list lst)
(define-public (split-list-by-separator lst pred)
"Split LST at each element that satisfies PRED, and return the parts
- (with the separators removed) as a list of lists. Example:
+ (with the separators removed) as a list of lists. Example:
(split-list-by-separator '(a 0 b c 1 d) number?) ==> ((a) (b c) (d))"
(let loop ((result '()) (lst lst))
(if (and lst (not (null? lst)))
(define-public (eval-carefully symbol module . default)
"Check if all symbols in expr SYMBOL are reachable
- in module MODULE. In that case evaluate, otherwise
- print a warning and set an optional DEFAULT."
+in module MODULE. In that case evaluate, otherwise
+print a warning and set an optional DEFAULT."
(let* ((unavailable? (lambda (sym)
(not (module-defined? module sym))))
(sym-unavailable (if (pair? symbol)