lilypond-user
[Top][All Lists]
Advanced

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

Re: When to Use Pound Signs


From: David Kastrup
Subject: Re: When to Use Pound Signs
Date: Tue, 05 Jan 2016 18:28:45 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Abraham Lee <address@hidden> writes:

> Jason,
>
> On Tuesday, January 5, 2016, Jason Silver <address@hidden>
> wrote:
>
>> I wonder if someone would explain the purpose of the pound signs when
>> indicating measurements?
>>
>> For example, this seems to work:
>>
>>   system-system-spacing #'padding = .8
>>
>>
>> But I often see examples with # marks like:
>>
>>   system-system-spacing #'padding = #2
>>
>
> The later form (with the #) was how it _used_ to be done, as a Scheme
> requirement, but our awesome developers have been able to eliminate the
> requirement of prefixing numbers using # in recent development
> versions.

Yes and no.  This assignment is expected to appear in a layout block,
and in a layout block it always worked like that.  In fact, if you want
to put a size like 0.8 \cm then you cannot even use Scheme for the
number.  In expressions used in music, 0.8 and 0.8 \cm started working
some time in the more recent past.  However, .8 or 8. still don't work
within music (and probably should never have worked anywhere at any time
if things had been designed sanely) which is not much of a surprise
since 8. needs to be a duration rather than a number.

In layout blocks, those sloppy numbers continue working.

So this is a mixture of sloppy conventions, sloppy history, and sloppy
design.  The general rule was to avoid Scheme numbers in parts of layout
and paper blocks and use them everywhere else.  Context modifications
changed camp from "output block syntax" to "music expression syntax"
also fairly recently and thus will no longer accept 8. or .8 as numbers.

> Both, however, remain perfectly valid input methods for back-ward
> compatibility. Other kinds of values will likely still need # to work
> properly.

There is also some slight difference in meaning for #{ ... #} since it's
not needed for the simplest numbers:

aaa = 8        % a number
bbb = #{ 8 #}  % a duration

aaa = -4       % a number
bbb = #{ -4 #} % a fingering event

Is that nice?  Frankly, I doubt it.  It's probably the best compromise
between being useful and being expected.

When a music function gets to see 8 or -4 as one of its input arguments,
its interpretation will depend on the predicate function.  I think that
if the predicate would permit either, the number will win like in the
assignment.  But I don't really remember.

So basically the "awesome developers" were wading through broken glass
barefoot in order to get to a defensible position.

-- 
David Kastrup



reply via email to

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