On Friday 28 February 2003 12:23, Adrian Howard wrote:
> Comments:
>
> -     I'd prefer is_set rather than is_math_set

So would I but eq_set is already taken by Test::More and I want to name the 
is_ and the eq_ functions conistently

> -     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

Can do.

> -     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.

Ignoring dupes is what a set does. I think the bag comaprisons are what you're 
after. Bag comparison will let you test for a specific number of copies of 
each element so

is_bag($thing, [$a, $b, $c])

will do what you want, there must be exactly 1 copy of $a, $b and $c and no 
more than 1,

F

Reply via email to