Skip to content

Commit

Permalink
Change IsZ_pi from a property to a category
Browse files Browse the repository at this point in the history
This seems correct, as there were no real methods to compute it. Also,
it is very similar to IsIntegers, which is also a category.

This makes a so-called "hidden" implication created by DeclareProperty
explicit, thereby resolving a bunch of warnings that show up if one
starts the upcoming GAP 4.11 with the `-N` command line option, and then
loads this package.

For some information on the background of this, see also
<gap-system/gap#1649> and
<gap-system/gap#2336>
  • Loading branch information
fingolfin committed Sep 6, 2019
1 parent 2f552de commit d74180b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/z_pi.gd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
##
DeclareConstructor( "Z_piCons", [ IsRing, IsList ] );
DeclareGlobalFunction( "Z_pi" );
DeclareProperty( "IsZ_pi", IsEuclideanRing );
DeclareCategory( "IsZ_pi", IsEuclideanRing and IsCyclotomicCollection );

#############################################################################
##
Expand Down
12 changes: 2 additions & 10 deletions lib/z_pi.gi
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ InstallMethod( Z_piCons, "natural Z_pi (ResClasses)", true,
IsRing and IsAttributeStoringRep ),
rec( primes := Immutable( pi ) ) );
SetIsTrivial( R, false );
SetIsZ_pi( R, true );
SetIsWholeFamily( R, false );
SetFilterObj( R, IsZ_pi );
SetZero( R, 0 ); SetOne( R, 1 );
SetIsFinite( R, false ); SetSize( R, infinity );
SetIsAssociative( R, true ); SetIsCommutative( R, true );
Expand All @@ -52,15 +53,6 @@ InstallGlobalFunction( Z_pi,
return Z_piCons( IsRing, Set( pi ) );
end );

#############################################################################
##
#M IsZ_pi( <obj> ) . . . . . . . . . . . . . . . . . . . . . . . . . Z_(pi)
##
## Return false, if the contrary is not known explicitly.
##
InstallOtherMethod( IsZ_pi, "for non-Z_(pi) (ResClasses)", true,
[ IsObject ], 0, ReturnFalse );

#############################################################################
##
#M ViewString( <R> ) . . . . . . . . . . . . . . . . . . . . . . for Z_(pi)
Expand Down

0 comments on commit d74180b

Please sign in to comment.