lilypond-devel
[Top][All Lists]
Advanced

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

Re: Axis_group_engraver + Scheme engraver for staff combining (issue 576


From: Saul Tobin
Subject: Re: Axis_group_engraver + Scheme engraver for staff combining (issue 576540043 by address@hidden)
Date: Mon, 18 Mar 2019 16:45:10 -0600

Will play around with AnnounceNewContext — looks like it does what I'm
looking for. Thanks!

For segmenting list by ##t/##f tail, my code needs to preserve order. The
##t/##f value represents whether the next staff down may be condensed
upward. So:

((1 . #t) (2 . #f) (3 . #t) (4 . #t)), if we imagine the numbers as staves,
means that 1+2 may be condensed together, and 3+4 may be condensed together
(the last t/f value doesn't matter), but that 2+3 must be separate.

((1 . #t) (2 . #t) (3 . #f) (4 . #t)) would allow 1+2+3 to be condensed,
with 4 separate.

Does that clarify things?

Saul

On Mon, Mar 18, 2019, 3:49 PM <address@hidden> wrote:

> 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)))
>
>
> > One question — is there a preferred way to get child contexts in
> Scheme?
> > Can't seem to find such a thing in the documentation but maybe I'm
> missing
> > something.
>
> We have AnnounceNewContext which may help.
> For an usage-example see:
> https://lists.gnu.org/archive/html/bug-lilypond/2019-03/msg00011.html
>
>
>
>
> https://codereview.appspot.com/576540043/
>


reply via email to

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