[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Patch: Make #{ ... #} wagonloads more useful
From: |
David Kastrup |
Subject: |
Re: Patch: Make #{ ... #} wagonloads more useful |
Date: |
Sun, 28 Aug 2011 00:41:49 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
David Kastrup <address@hidden> writes:
> Previously #{ ... #} created only sequential music. This changes it to
> accept everything an assignment accepts. Incompatibility to before:
> #{ #} returns a void music expression, #{ music #} does not create a
> sequential music list but just a single music event,
> only #{ music music ... #} works just the same as before.
>
> <URL:http://codereview.appspot.com/4974046>
Here is a fun example:
the extending documentation contains the example
Inline Scheme code
The main disadvantage of `\tweak' is its syntactical inflexibility.
For example, the following produces a syntax error.
F = \tweak #'font-size #-3 -\flageolet
\relative c'' {
c4^\F c4_\F
}
It then procedes to work around using
F = #(let ((m (make-music 'ArticulationEvent
'articulation-type "flageolet")))
(set! (ly:music-property m 'tweaks)
(acons 'font-size -3
(ly:music-property m 'tweaks)))
m)
Ugh. But with the new patch, this can be reduced to
F = ##{-\tweak #'font-size #-3 -\flageolet#}
If you check the resulting expressions, you'll find that apart from the
added origin property they are identical.
Is that smooth or what?
--
David Kastrup