in reply to RFC - Data::DeepFilter

I don't see much here that cannot be done with Data::Rmap?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: RFC - Data::DeepFilter
by imp (Priest) on Aug 23, 2006 at 02:13 UTC
    Ahh I had searched cpan and asked in the chatterbox for related modules, but the closest match in functionality I could find was Data::Walk.

    Data::Rmap looks like a nice module with a very similar intent, but it doesn't seem to use copy-on-write to protect the original structure. Please correct me if I overlooked something.

    My intention with the cheap copy-on-write is to only clone the branches that have changes, and to use a cheap shallow copy for the unchanged branches. This way if you have a reference to a large dataset (e.g. cached lookup tables) you will not be wasting memory by cloning unmodified nodes.

      I'd suggest contacting the author of Data::Rmap and discussing whether he would accept a patch from you that adds COW (or the option of it) before you consider releasing your own module.

      I know that pride of ownership makes it tough to give up on releasing something that you've written, but remember that monks are supposed to be humble, too. :-)

      -xdg

      Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

      Hello imp,

      I wrote Data::Rmap and do like patches (even suggestions). Using COW in combination with Rmap hadn't occurred to me but I see it could be useful. Enabling it via an option to Rmap would probably be awkward, especially if you could just Data::COW::make_cow_ref the data structure then rmap the COW copy. I'd need to check that it works as I expect but don't have the time today...

      If it does work I'll add an example to the docs and leave Data::Rmap doing one simple task.