Skip to content

Commit

Permalink
Merge pull request #1467 from zickgraf/filter_ntuple
Browse files Browse the repository at this point in the history
Fix IsSpecializationOfFilter for strings defining tuples
  • Loading branch information
zickgraf authored Sep 25, 2023
2 parents c322549 + 638d1c1 commit 95f09b4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CAP/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SetPackageInfo( rec(

PackageName := "CAP",
Subtitle := "Categories, Algorithms, Programming",
Version := "2023.09-08",
Version := "2023.09-09",
Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ),
License := "GPL-2.0-or-later",

Expand Down
33 changes: 27 additions & 6 deletions CAP/gap/ToolsForCategories.gi
Original file line number Diff line number Diff line change
Expand Up @@ -889,21 +889,42 @@ InstallGlobalFunction( InstallDeprecatedAlias,
end );

##
InstallGlobalFunction( "IsSpecializationOfFilter", function ( filter1, filter2 )
InstallGlobalFunction( "IsSpecializationOfFilter", function ( filter_1, filter_2 )
local data_type_1, data_type_2;

if IsString( filter1 ) then
if IsString( filter_1 ) then

filter1 := CAP_INTERNAL_REPLACED_STRING_WITH_FILTER( filter1 );
data_type_1 := CAP_INTERNAL_GET_DATA_TYPE_FROM_STRING( filter_1 );

if data_type_1 = fail then

filter_1 := IsObject;

else

filter_1 := data_type_1.filter;

fi;

fi;

if IsString( filter2 ) then
if IsString( filter_2 ) then

filter2 := CAP_INTERNAL_REPLACED_STRING_WITH_FILTER( filter2 );
data_type_2 := CAP_INTERNAL_GET_DATA_TYPE_FROM_STRING( filter_2 );

if data_type_2 = fail then

filter_2 := IsObject;

else

filter_2 := data_type_2.filter;

fi;

fi;

return IS_SUBSET_FLAGS( WITH_IMPS_FLAGS( FLAGS_FILTER( filter2 ) ), WITH_IMPS_FLAGS( FLAGS_FILTER( filter1 ) ) );
return IS_SUBSET_FLAGS( WITH_IMPS_FLAGS( FLAGS_FILTER( filter_2 ) ), WITH_IMPS_FLAGS( FLAGS_FILTER( filter_1 ) ) );

end );

Expand Down

0 comments on commit 95f09b4

Please sign in to comment.