[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Axis_group_engraver + Scheme engraver for staff combining (issue 576
From: |
David Kastrup |
Subject: |
Re: Axis_group_engraver + Scheme engraver for staff combining (issue 576540043 by address@hidden) |
Date: |
Mon, 18 Mar 2019 23:26:01 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
address@hidden writes:
> On 2019/03/17 01:45:49, saul.james.tobin wrote:
>
>> Re cdr is not a predicate — the list being processed here is composed
> of
>> pairs, the cdr of which is ##t or ##f.
>
> The description is still confusing. Do you mean something like below?
>
> #(define (divide-true-cdr ls)
> "Split @var{ls} into those elements which do and don't have a tail of
> value
> @code{#t}"
> (call-with-values
> (lambda () (partition (lambda (x) (eq? #t (cdr x))) ls))
> (lambda (a b) (list a b))))
>
> #(display (divide-true-cdr '((1 . #f) (2 . #t) (3 . #f))))
>
> => (((2 . #t)) ((1 . #f) (3 . #f)))
The silence of the lambdas (almost):
#(define (divide-true-cdr ls)
"Split @var{ls} into those elements which don't and do have a tail of
value @code{#tf}"
(call-with-values (lambda () (partition cdr ls)) list))
#(display (divide-true-cdr '((1 . #f) (2 . #t) (3 . #f))))
=> (((2 . #t)) ((1 . #f) (3 . #f)))
--
David Kastrup