]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/c++.scm
release: 1.5.36
[lilypond.git] / scm / c++.scm
index dc1bad45a80a2ba913ca64adcca1ebd167d8e527..5fea3d145d552e52751a2f415bc269bbe043b474 100644 (file)
 
 
 
+(define (take-from-list-until todo gathered crit?)
+  "return (G, T), where (reverse G) + T = GATHERED + TODO, and the last of G
+is the  first to satisfy CRIT "
+  (if (null? todo)
+      (cons gathered todo)
+      (if (crit? (car todo))
+         (cons (cons (car todo) gathered) (cdr todo))
+         (take-from-list-until (cdr todo) (cons (car todo) gathered) crit?)
+      )
+  ))
+; test:
+; (take-from-list-until '(1 2 3  4 5) '() (lambda (x) (eq? x 3)))
+; ((3 2 1) 4 5)
+
+
+
 ; Make a function that checks score element for being of a specific type. 
 (define (make-type-checker symbol)
   (lambda (elt)