Re: [frogs] Stepping into the code for nested properties

[ Thread Index | Date Index | More lilynet.net/frogs Archives ]




On 5/14/10 4:14 AM, "Rodolfo Zitellini" <xhero.gm@xxxxxxxxx> wrote:

> Sorry, I preovously replyed only to Carl :)
> 
> I did some more investigation on the issue, and I think it all bolis
> down simply to the fact that reverting a nested property will revert
> it even if it was not overridden before.
> Nested reverting works like this:
> 1) Get the first instance of the nested proeprty list
> 2) get the first instance of the eventual sublist of properties
> 3) find the first instance of the property
> 4) drop it
> 
> This works only assuming that you always have two copies (overridden
> and original) of the property you are reverting in the very first
> instance of it's parent list, with the overridden value in the head of
> the list.

So this seems like it should work, and it seems pretty simple (I was working
on some more complicated ways to handle it, IIRC).

Does your algorithm still work if you do something like:

\override MyGrob #'(bound-details left Y)  = #10
\override MyGrob #'(bound-details right X) =  #20
\revert MyGrob #'(bound-details left Y)

And will it work with

\override MyGrob #'(bound-details left Y)  = #10
\override MyGrob #'(bound-details right X) =  #20
\revert MyGrob #'bound-details

> I think we can just modify nested_property_revert_alist() to prevent
> it from dropping non-overridden values. We can simply check if we find
> at least another copy of the property, so we can assume safely that
> the first one we drop is the overridden one. If just only one copy is
> found we can assume that it is the original, and not drop it.
> What do you think about it? I made a slight mod
> nested_property_revert_alist() and the idea seems to work, if you want
> I can try to post a little patch :)

I think that a patch, including a test file (that can be added to our
regression tests) would be a great idea!

Thanks!

Carl



---
----
Join the Frogs!


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/