in reply to Re: RFC - Data::DeepFilter
in thread RFC - Data::DeepFilter

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.

Replies are listed 'Best First'.
Re^3: RFC - Data::DeepFilter
by xdg (Monsignor) on Aug 23, 2006 at 11:32 UTC

    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.

Re^3: RFC - Data::DeepFilter
by bsb (Priest) on Aug 24, 2006 at 01:55 UTC
    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.