[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Re: where to put useful lists in the docs?
From: |
Mark Polesky |
Subject: |
[PATCH] Re: where to put useful lists in the docs? |
Date: |
Fri, 29 May 2009 01:42:16 -0700 (PDT) |
Mark Polesky wrote:
> ... I've ended up writing quite a few of
> these functions without knowing that they were all here.
Here's another useful set of procedures that is not in
lily-library.scm. These functions make quick work of calculating
offsets, extents, bounding-boxes, etc. I've attached a patch in
case anyone feels this is worth including.
- Mark
;; defines 7 functions:
;; pair_+ pair_- pair_* pair_/
;; pair_gcd pair_lcm pair_min pair_max pair_average.
;; eg. (pair_+ '(1 . 1) '(2 . 3) '(5 . 8)) ==> (8 . 12)
;; (pair_min '(1 . 8) '(1 . 5) '(2 . 3)) ==> (1 . 3)
(map primitive-eval
(map
(lambda (f)
`(define-public
(,(symbol-append 'pair_ f) . pairs)
(apply (lambda (f . pairs)
((lambda (lst) (cons (car lst) (cadr lst)))
(primitive-eval
(append `(map ,f)
(map (lambda (x) `(list ,(car x) ,(cdr x)))
pairs)))))
,f pairs)))
'(+ - * / gcd lcm min max average)))
0003-lily-library.scm-math-functions-for-pairs.patch
Description: Binary data
- where to put useful lists in the docs?, Mark Polesky, 2009/05/25
- Re: where to put useful lists in the docs?, Mark Polesky, 2009/05/25
- Re: where to put useful lists in the docs?, Neil Puttock, 2009/05/28
- Re: where to put useful lists in the docs?, Mark Polesky, 2009/05/29
- [PATCH] Re: where to put useful lists in the docs?,
Mark Polesky <=
- Re: [PATCH] Re: where to put useful lists in the docs?, Mark Polesky, 2009/05/30
- Re: [PATCH] Re: where to put useful lists in the docs?, Nicolas Sceaux, 2009/05/30
- Re: [PATCH] Re: where to put useful lists in the docs?, Werner LEMBERG, 2009/05/30
- Re: [PATCH] Re: where to put useful lists in the docs?, Mark Polesky, 2009/05/30
- Re: [PATCH] Re: where to put useful lists in the docs?, Mark Polesky, 2009/05/30
- Re: where to put useful lists in the docs?, Graham Percival, 2009/05/30