lilypond-devel
[Top][All Lists]
Advanced

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

Re: Cues (CueVoice) and quoted instrument name : InstrumentSwitch


From: David Kastrup
Subject: Re: Cues (CueVoice) and quoted instrument name : InstrumentSwitch
Date: Tue, 11 Oct 2011 08:35:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

"Keith OHara" <address@hidden> writes:

>>>>  so it can take *optional* arguments,
>>> I have not yet learned to use David's new facility for optional arguments...
>>
>> Please report the parts of the documentation you find hard to
>> understand.  Optional arguments are quite easy to use: if reading the
>> documentation gives you a headache, there is something wrong with it.
>
> The new docs are clear, mostly it took me some time to re-learn
> everything in "Extending" up to your addition.  (I have done no
> extending myself beyond adapting other people's Lisp-in-Lilypond.)
>
> It would be good to warn people that optional arguments must come
> immediately before an argument that will be read in LilyPond syntax,
> so that the parser knows which argument is missing.

That's not exactly true: optional arguments can be _skipped_ only when
the following actual non-optional argument looks differently to the
parser.  

Scheme arguments currently look all the same to the parser: letting the
parser _call_ the actual predicate for deciding how to parse on is hard.
It must not have made any irreversible decisions at that point of time.
And what Bison's LALR(1) parser algorithm considers irreversible is a
bit tricky.

I'll take a look whether just implementing this predicate-based
backtracking for optional-Scheme-before-Scheme is feasible on the
current code base: in the long run, I'll make this much more reliable.

-- 
David Kastrup




reply via email to

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