lilypond-devel
[Top][All Lists]
Advanced

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

Re: \once \revert


From: David Kastrup
Subject: Re: \once \revert
Date: Sun, 21 Aug 2011 11:01:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Carl Sorensen <address@hidden> writes:

> On 8/21/11 1:45 AM, "David Kastrup" <address@hidden> wrote:
>
>> My suggestion
>> would be
>> 
>> \set x = 4           ; setting the default
>> \override x = 5      ; context set has 5
>> \override x = 2      ; context set has 5 2, result 5
>> \once\override x = 3 ; context set has 3(o) 5 2, result 3
>> \revert x            ; context set has 3(o) 2, result 3
>> [wait ...]           ; context set has 2 result 2
>> 
> Yes, this is clearly better than my proposal.

Also wrong, since I mixed up the order of 2 and 5.  I hope you
understood what I meant rather than what I wrote.  The following should
be better:

\set x = 4           ; setting the default
\override x = 5      ; context set has 5
\override x = 2      ; context set has 2 5, result 2
\once\override x = 3 ; context set has 3(o) 2 5, result 3
\revert x            ; context set has 3(o) 5, result 3
[wait ...]           ; context set has 5 result 5


Anyway, I chose to let \revert have a delayed action as the lesser evil
over letting it have both an immediate as well as an independent delayed
action.  The latter just feigns to be unsurprising.

> I agree that the semantics you propose are cleaner to explain.  It
> would even be simple to add a warning if \once \revert found no \once
> entry on the stack to \revert, so the user wouldn't be surprised.

Well, \set is pretty much equivalent to revert+override, and at least
this implicit revert should rather be silent.  But anyway, that's a
detail not influencing the design of the code.

-- 
David Kastrup



reply via email to

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