On Mon, Jun 27, 2005 at 01:41:30AM +0100, Fergal Daly wrote: > I'm not sure there is a right way to deparse closures (in general). > For example if a variable is shared between 2 closures then it only > makes sense to deparse both of them together. Deparsing them in turn > will lose the sharedness info.
It would be less wrong than what B::Deparse is currently doing: completely ignoring closure data. > How many people would actually understand that caveat? About the same amount that use and understand closures. I'm perfectly happy to punt this problem over to B::Deparse and let them figure it out. As it stands B::Deparse is the best we can do with code refs. What's the alternative? > > > For 2 B::Deparse works and might be the only way but then again, it > > > might be better to just get access to the original string of code > > > before it gets compiled, > > > > If they want to compare the original string they should have put it in their > > data structure. Simp. > > That is exacltly what I was suggesting, So are we just having an agreement? Another way to look at the "eval" case is to apply it to other references. is_deeply( eval "{ foo => 42, bar => 23 }", { "bar", 42, "foo", 23 } ); Even though the code is written differently the resulting data is the same. Would anyone be in doubt that it should pass? -- Michael G Schwern [EMAIL PROTECTED] http://www.pobox.com/~schwern Ahh email, my old friend. Do you know that revenge is a dish that is best served cold? And it is very cold on the Internet!