lilypond-devel
[Top][All Lists]
Advanced

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

Re: [Lilypond-auto] Issue 2856 in lilypond: Patch: Get along with use of


From: David Kastrup
Subject: Re: [Lilypond-auto] Issue 2856 in lilypond: Patch: Get along with use of grob-property instead of grob-property-path in overrides
Date: Mon, 24 Sep 2012 12:55:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

Marc Hohl <address@hidden> writes:

> Am 24.09.2012 12:04, schrieb address@hidden:
>> Status: New
>> Owner: ----
>> Labels: Type-Enhancement Patch-new
>>
>> New issue 2856 by address@hidden: Patch: Get along with use of
>> grob-property instead of grob-property-path in overrides
>> http://code.google.com/p/lilypond/issues/detail?id=2856
>>
>> Get along with use of grob-property instead of grob-property-path in
>> overrides
>>
>> LilyPond uses a willy-nilly mixture of grob-property and
>> grob-property-path when generating overrides programmatically (the
>> parser only uses grob-property-path).  Several override-reinterpreting
>> commands and functionalities were not prepared to deal with this.
>>
>> http://codereview.appspot.com/6544060
>>
>>
>>
> A quick glance at the code shows
>
> +                      (cond
> +                       ((ly:music-property m 'grob-property #f) => list)
> +                       (else
> +                        (ly:music-property m 'grob-property-path)))))
>
> what does the second line mean? I have never seen '=>' in a scheme program.
>
> Sorry for this beginner's question...

The Guile manual states:

 -- syntax: cond clause1 clause2 ...
     Each `cond'-clause must look like this:

          (TEST EXPRESSION ...)

     where TEST and EXPRESSION are arbitrary expression, or like this

          (TEST => EXPRESSION)

     where EXPRESSION must evaluate to a procedure.

     The TESTs of the clauses are evaluated in order and as soon as one
     of them evaluates to a true values, the corresponding EXPRESSIONs
     are evaluated in order and the last value is returned as the value
     of the `cond'-expression.  For the `=>' clause type, EXPRESSION is
     evaluated and the resulting procedure is applied to the value of
     TEST.  The result of this procedure application is then the result
     of the `cond'-expression.

So if the value is different from #f, the result of the cond is
generated by calling 'list on this value.

-- 
David Kastrup




reply via email to

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