Comments:
- I'd prefer is_set rather than is_math_set
- I'd like shallow comparison options as well as deep ones. Most of the time I'm interested in object identity rather than structural equality. Maybe have: is_bag, is_set, is_deep_bag, is_deep_set
- I'm not sure that ignoring duplicates for is_math_set will always be the right thing to do. When I've wanted set comparisons duplicates would be indicative of an error. Having both options would be nice.
Cheers,
Adrian
On Thursday, February 27, 2003, at 07:36 pm, Fergal Daly wrote:
I've been discussing this with Mr Schwern recently but he's a little indisposed at the moment so this seemed like a good place for feedback.
Test::More's eq_set() is not a set comparison or a bag comparison but a
strange array comparison where the order of scalars doesn't matter but the
order of refs does, except for deeply equalrefs, which can be interchanged.
So
perl -MTest::More -e 'print eq_set([ [], {} ], [ {}, [] ])."\n"'
prints 0
Attached is Test::Set which provides true deep set and bag comparisons and
bagset.t some tests.
Any comments welcome,
F
--
Do you need someone with lots of Unix sysadmin and/or lots of OO software
development experience? Go on, giz a job.
My CV - http://www.fergaldaly.com/cv.html
<bagset.t><Set.pm>