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: Marc Hohl
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 20:25:40 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0

Am 24.09.2012 12:55, schrieb David Kastrup:
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.

Thanks for the explanation! I did a quick search on google about that, but
the guile manual was not even mentioned among the results on the first page ...

Scheme becomes more and more fascinating ...

Regards,

Marc



reply via email to

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