On 6/27/05, Michael G Schwern <[EMAIL PROTECTED]> wrote: > On Mon, Jun 27, 2005 at 11:20:07AM +0100, Fergal Daly wrote: > > > 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? > > > > I'd argue that currently the best you can do is == because it never > > gives a false positive. Consistent false negatives are harmless. > > But it does reduce its utility. Means you can't use is_deeply() to test > serialization. How important is that, I wonder. > > It also means code refs are treated differently than all other refs. In > all other cases we peek inside the data referred to by the reference. That's > why its a "deep" check.
Forgetting philosphical arguments about what's the right thing to do, I think the strongest point against this is that there may be people out there who expect the current behaviour, they expect 2 different closures to be unequal, they may even have tests that depend on this and which have caught legitimate bugs in the past. These tests will no longer do what they were originally written to do. > > If someone really wanted, they could use XS to create subref_eq which > > pokes around inside closures, comparing the code and also comparing > > the value of closed variables but that seems extreme, > > At that point you might as well just fix B::Deparse. True, F