lilypond-user
[Top][All Lists]
Advanced

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

Re: Flat flared hairpins


From: Thomas Morley
Subject: Re: Flat flared hairpins
Date: Mon, 31 Dec 2018 13:07:53 +0100

Am Mo., 31. Dez. 2018 um 10:43 Uhr schrieb Malte Meyn <address@hidden>:
>
>
>
> Am 31.12.18 um 09:58 schrieb Andrew Bernard:
> >
> > Why do you have to use cadr and not cdr on the ly:grob-set-property
> > line? Isn't the broken part the second item in a list of two items? How
> > to understand this?
>
> In Scheme, a list is a pair, containing the head/car (first element of
> the list) and tail/cdr (sublist of all other elements). A list
> containing only one element is a pair of that element and an empty list '().
>
> '(1 2 3 4 5)
> is the same as
> '(1 . (2 . (3 . (4 . (5 . ()))))
>
> So the car of the list above is 1, the cdr is '(2 3 4 5). If you want to
> get the 2, you have to take the car of '(2 3 4 5). And cadr is short for
> “car of cdr”.

Or use 'second' a srfi-1-procedure, which provided by LilyPond as
default: (second '(1 2 3))
Or 'list-ref': (list-ref '(1 2 3) 1) NB first element of a list is at
position zero.


Cheers,
  Harm



reply via email to

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