%mathpiper,def="EqualAsSets"

//Retract("EqualAsSets",*);

10 # EqualAsSets( A_IsList, B_IsList )_(Length(A)=Length(B)) <--
[
    Local(Acopy,b,nba,result);
    Acopy  := FlatCopy(A);
    result := True;
    ForEach(b,B)
     [
         nba := Find(Acopy,b);
         If( nba < 0, [ result := False; Break(); ] );
         DestructiveDelete(Acopy,nba);
     ];
     If( Not result, result := Length(Acopy)=0 );
     result;
];

20 # EqualAsSets( _A, _B ) <-- False;

%/mathpiper


