lilypond-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Re: where to put useful lists in the docs?


From: Werner LEMBERG
Subject: Re: [PATCH] Re: where to put useful lists in the docs?
Date: Sat, 30 May 2009 11:44:13 +0200 (CEST)

> [...] why not define a function that takes a function and a list of
> pairs? It's usual to have procedure arguments:
> 
> (define (map-on-pairs fn pairs)
>   (cons (apply fn (map car pairs))
>         (apply fn (map cdr pairs))))
> 
> (map-on-pairs + '((1 . 1) (2 . 3) (5 . 8))) => (8 . 12)
> (map-on-pairs min '((1 . 8) (1 . 5) (2 . 3))) ==> (1 . 3)

Very nice!


    Werner




reply via email to

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