lilypond-devel
[Top][All Lists]
Advanced

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

Re: \once \revert


From: Reinhold Kainhofer
Subject: Re: \once \revert
Date: Sun, 21 Aug 2011 10:45:02 +0200

On So., 21. Aug. 2011 02:33:06 CEST, Carl Sorensen <address@hidden> wrote:
> My thought for the architecture is to have two sets of properties -- the
> context set and the \once set.

That's exactly what I was about to propose, too. override basically sets the 
default, vbut a once always always takes precedence. You don't have to worry 
about restoring the old value (which one? as those examples highlight) at the 
end of the timestep, you just have to clear the once value.

> When \override x=3 is received, it's put on both the \once set and the
> context set.

I wouldn't go that far. I would say that a once always overrides all overrides.

> When it's time to get a property, since the \once set is not null, we get
> the value from the \once set.
> 
> At the next time step, we set the \once set back to null,

In the finalization hook of the current moment...

> This comes at the price of carrying a second set of context properties
> when we have a \once.

But that's just a single value, no stack or complex data structure...


> \revert means "apply the revert to the context set.   If the \once set is
> not empty, also apply it to the \once set."

\once\revert would simply set the once value to the second-to-last value of the 
override stack.

> With this architecture, I don't think there are any surprises.

Yes, I agree. Override and revert always set the global (grob-wide) default, a 
once always overrides that.

> As described above, I'd have \once work on the \once overrides, but I'd
> have not-\once work on both sets.

I wouldn't have override cancel a \once\override, but that's a matter of taste.

Cheers,
Reinhold



reply via email to

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