# This method should not be selected when the two objects belong to the same category and the category can compute IsEqualForObjects.
InstallOtherMethod( IsEqualForObjects,
[ IsCapCategory, IsCapCategoryObject, IsCapCategoryObject ],
function( cat, object_1, object_2 )
if not HasCapCategory( object_1 ) then
Error( Concatenation( "the object \"", String( object_1 ), "\" has no CAP category" ) );
fi;
if not HasCapCategory( object_2 ) then
Error( Concatenation( "the object \"", String( object_2 ), "\" has no CAP category" ) );
fi;
if not IsIdenticalObj( CapCategory( object_1 ), cat ) then
Error( Concatenation( "the object \"", String( object_1 ), "\" does not belong to the CAP category <cat>" ) );
elif not IsIdenticalObj( CapCategory( object_2 ), cat ) then
Error( Concatenation( "the object \"", String( object_2 ), "\" does not belong to the CAP category <cat>" ) );
else
# convenience: as long as the objects are identical, everything "just works" if IsIdenticalObj( object_1, object_2 ) then
return true;
else
Error( "Cannot decide whether the object \"", String( object_1 ), "\" and the object \"", String( object_2 ), "\" are equal. You can fix this error by installing `IsEqualForObjects` in <cat> or possibly avoid it by enabling strict caching\n" );
if CapCategory( object_1 )!.input_sanity_check_level > 0 or CapCategory( object_2 )!.input_sanity_check_level > 0then if not IsIdenticalObj( CapCategory( object_1 ), CapCategory( object_2 ) ) then
Error( Concatenation( "the object \"", String( object_1 ), "\" and the object \"", String( object_2 ), "\" do not belong to the same CAP category" ) ); fi; fi;
return IsEqualForObjects( object_1, object_2 ); end );
if not CanCompute( cat, "ObjectConstructor" ) then
Error( "You are calling the generic \"/\" method, but <cat> does not have an object constructor. Please add one or install a special version of \"/\"." );
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.