[Top][All Lists]
[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
0001-lily-library.scm-Rewrite-split-at-predicate-procedur.patch
Description: Binary data
0002-lily-library.scm-Make-some-local-functions-public.patch
Description: Binary data
- Re: [PATCH] Make some local functions public (was: Re: lily-library.scm question), Patrick McCarty, 2009/06/04
- Re: [PATCH] Make some local functions public (was: Re: lily-library.scm question), Neil Puttock, 2009/06/07
- Re: [PATCH] Make some local functions public (was: Re: lily-library.scm question), Mark Polesky, 2009/06/07
- Re: [PATCH] Make some local functions public (was: Re: lily-library.scm question), Mark Polesky, 2009/06/14
- Re: [PATCH] Make some local functions public (was: Re: lily-library.scm question), Joe Neeman, 2009/06/15
- Re: [PATCH] Make some local functions public (was: Re: lily-library.scm question), Jay Anderson, 2009/06/17
- Re: [PATCH] Make some local functions public,
Mark Polesky <=
- Re: [PATCH] Make some local functions public (was: Re: lily-library.scm question), Mark Polesky, 2009/06/22
- Re: [PATCH] Make some local functions public (was: Re: lily-library.scm question), Jay Anderson, 2009/06/23
- Re: [PATCH] Make some local functions public (was: Re: lily-library.scm question), Mark Polesky, 2009/06/23
- Re: [PATCH] Make some local functions public (was: Re: lily-library.scm question), Mark Polesky, 2009/06/23
- Re: [PATCH] Make some local functions public, Mark Polesky, 2009/06/23
- Re: [PATCH] Make some local functions public (was: Re: lily-library.scm question), Han-Wen Nienhuys, 2009/06/23
- Re: [PATCH] Make some local functions public (was: Re: lily-library.scm question), Mark Polesky, 2009/06/23
- Re: [PATCH] Make some local functions public (was: Re: lily-library.scm question), Han-Wen Nienhuys, 2009/06/24
- Re: [PATCH] Make some local functions public (was: Re: lily-library.scm question), Mark Polesky, 2009/06/24
- Re: [PATCH] Make some local functions public (was: Re: lily-library.scm question), Carl D. Sorensen, 2009/06/24