lilypond-devel
[Top][All Lists]
Advanced

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

another feature for #{ ... #}


From: Han-Wen Nienhuys
Subject: another feature for #{ ... #}
Date: Sun, 26 Sep 2004 18:00:21 +0200

address@hidden writes:
> lyricStaff = #(def-music-function (location voice-markup music lyrics) 
> (markup? ly:music? ly:music?)
>            "
> Add a Voice with lyrics and an instrument name. Syntax: 
>   \lyricStaff #(markup \"instrument name\")
>     \notemode { c d e f }
>     \lyricmode { do r? mi fa }
> "
>                (let ((name (gen-unique-context)))
>                 #{ << \context Voice = @name << 
>                         \set Staff . instrument = $voice-markup 
>                         $music >>
>                       \lyricsto @name \new Lyrics $lyrics
>                    >> #}))
> 

I don't see the point. Why doesn't it work when you use $name ?
\context should also be able to take a STRING_IDENTIFIER for the id.

> May I?

I would try to excercise extreme caution in adding such
functionality. Once you add it, you have a certain reponsibility to
keep supporting this. If you add too much things, it easily becomes
spaghetti.

In addition, your feature (textual substitution), can easily lead to
confusing syntactical errors, which is why I have been so strongly
against macro languages (textual substitution) in the past.




-- 
 Han-Wen Nienhuys   |   address@hidden   |   http://www.xs4all.nl/~hanwen 





reply via email to

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