lilypond-devel
[Top][All Lists]
Advanced

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

Re: [Parser] Lookahead in music function arguments


From: David Kastrup
Subject: Re: [Parser] Lookahead in music function arguments
Date: Mon, 08 Oct 2012 10:12:20 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

Keith OHara <address@hidden> writes:

> Werner LEMBERG <wl <at> gnu.org> writes:
>
>> > I lean towards letting numbers in function arguments just evaluate
>> > to themselves, never mind units. 
>
> Sensible.
>
>> +1.  However, it should be documented, together with the work-around.
>
> It was only a couple months ago that David allowed  3\cm  to be used as a 
> number within music.   Formerly it was allowed only in \paper {indent=3\cm} 
> and other such blocks.
>
> Only people reading this mailing list knew about it, none has said they 
> use it, and I cannot imagine anyone else has stumbled upon it and started
> to use it.  So there is nothing to document and no desired behavior for 
> which to provide a work-around.

Well, there is a whole lot to document as the state before and after
change is not really given a whole lot of attention in the manual, but
then quite a bit of it is transitory as well.  The use of 3\cm in music
is actually not even possible right now since cm itself is only defined
in paper blocks (possibly layout blocks as well) and besides, real
numbers are not recognized in music mode.  This was, more or less,
preparing for the situation that we want to use define-scheme-function
for providing functions doing calculations in layout blocks.  That is,
after all, quite feasible.

In assignments, things like 3\cm are unambigous as \cm has nowhere else
to go.  And as the last function argument of a toplevel function, the
situation would be similar.  However, if the function is not toplevel
and not in end position itself, the \cm could equally well be a
different function argument.

I am not fond of the idea of treating "last argument" specially.  In
particular, it implies that the last argument will more likely than
others cause lookahead to occur, and that's the least desirable
situation for having lookahead.

-- 
David Kastrup




reply via email to

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