lilypond-devel
[Top][All Lists]
Advanced

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

Re: Patch: Make #{ ... #} wagonloads more useful


From: Carl Sorensen
Subject: Re: Patch: Make #{ ... #} wagonloads more useful
Date: Sat, 27 Aug 2011 16:46:52 -0600

On 8/27/11 4:41 PM, "David Kastrup" <address@hidden> wrote:

> 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,

I assume that if you want to get a sequential music, you could do

#{ {music} #}


>> 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?

What, are you trying to make it easy for users to do complicated things?
Why in the world would you want to do that?

This is WAY cool.  Thanks!


Carl




reply via email to

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