lilypond-user
[Top][All Lists]
Advanced

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

Re: tiny function


From: David Kastrup
Subject: Re: tiny function
Date: Sat, 02 Jul 2016 07:17:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Thomas Morley <address@hidden> writes:

> Well, not really. As said before, my feelings were ambivalent.
>
> After reconsidering:
>
> It's more a possibility I sometimes use. Mostly because of lazyness in typing.
>
> Writing
> \new Staff \with \some-function-returning-a-context-modification ...
> instead of
> \new Staff \some-function-returning-a-context-modification ...
> is not a big deal. A few key-strokes nothing else ...
> Though, I thought it was the OP's main point.

I am not sure it was the main point.  The problem is that the function
does need the \with (and scheme functions are comparatively new as
opposed to \with \identifier) indeed and cannot omit it.

> Otoh, we can store things like \paper, \layout, \midi, \with and as
> off issue 4908 even \header in variables.
> But when called, the variable needs to be wrapped in a proper manner,
> sometimes not. Example:
>
> ppr = \paper { ragged-right = ##f }
>
> %% works
> \book {
>   \paper { \ppr }
>   { ces''1 }
> }
>
> %% doesn't work
> \book {
>   \ppr
>   { cis''1 }
> }
>
> %% works
> \ppr
> { cisis''1 }
>
> Admittedly, this example is about \paper not \with, more, I use always
> fixed values no function calls and other things are coming into the
> game.

Argh!

This is just a bug.  It's supposed to work but apparently fails.  The
parser obviously does all of the parsing (there is no error message) but
the processing does not quite do the right thing.

> Though, I'd love to see it consistent for all of \paper, \layout,
> \midi, \with and \header, regardless if it's a function call or not,
> regardless where called.

In some respects that depends on where the parser goes.  It's really
really quite at its limit concerning parsing comparatively free-form
expressions with its lookahead.  So it's often give one, take one.

-- 
David Kastrup



reply via email to

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