lilypond-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Make some local functions public


From: Mark Polesky
Subject: Re: [PATCH] Make some local functions public
Date: Tue, 16 Jun 2009 22:47:45 -0700 (PDT)

Jay Anderson wrote:

> Also it should avoid length when a null? check will do. Here's the
> function with those changes:
> 
> (define-public (split-at-predicate predicate lst)
>   "Split a list into 2 lists at the first element that returns #f for
>   (predicate 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 (or (null? lst) (null? (cdr lst)))
>     (list lst)
>     (let loop ((lst-a (list (car lst))) (lst-b (cdr lst)))
>       (cond ((null? lst-b) (list lst))
>             ((predicate (car lst-a) (car lst-b))
>               (loop (cons (car lst-b) lst-a) (cdr lst-b)))
>             (else (cons (reverse lst-a) lst-b))))))


Jay and Joe,
thanks for you help. Now, if there are no more objections,
anyone want to apply the new patches? Thanks!

- Mark



      

Attachment: 0001-lily-library.scm-Rewrite-split-at-predicate-procedur.patch
Description: Binary data

Attachment: 0002-lily-library.scm-Make-some-local-functions-public.patch
Description: Binary data


reply via email to

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