[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: music-functions: #$var1 or just $var1 ?
From: |
Mark Polesky |
Subject: |
Re: music-functions: #$var1 or just $var1 ? |
Date: |
Sun, 25 Apr 2010 20:59:36 -0700 (PDT) |
Carl Sorensen wrote:
> As I understand it, in LilyPond input, the # is a token
> that indicates a Scheme expression follows.
>
> In a #{ #} expression, $ is a token that indicates a
> Scheme expression to be evaluated follows.
And all this time I thought $ was only for referencing the
function's arguments. Perhaps we should always prefer $
over # inside music function definitions? Like so:
colorNote =
#(define-music-function
(parser location color-value)
(scheme?)
#{
\once \override NoteHead $'color = $color-value
#})
\relative c' { c d \colorNote #red e f }
> I don't think that #$ is ever required inside of #{ #}.
>
> And there are some places where we use # that it is not
> strictly required, i.e. where the argument needs to be a
> string, and it can be either a LilyPond string (no #) or a
> Scheme string (start with a #).
>
> We made a decision a number of years ago to always put #
> in if it was accepted, even when it wasn't required, in
> order to be more consistent.
That's nice, but in this particular case, I think most users
will find this *inconsistent*. Far easier to remember to
always use a $ than to get bogged down with #-correctness.
> In my opinion, we should not request that the user use #$,
> but we should just indicate that inside a #{ #} block $ is
> used to indicate a Scheme expression to be evaluated.
+1
- Mark