Skip to content

Commit

Permalink
Add FiltersObj and FiltersType functions
Browse files Browse the repository at this point in the history
* FiltersType returns the list of filters set in the
  passed type
* FiltersObj does the same for the passed object
  • Loading branch information
markuspf committed Oct 24, 2016
1 parent b6c12ed commit c06046c
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/ref/makedocreldata.g
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ GAPInfo.ManualDataRef:= rec(
"../../lib/tuples.gd",
"../../lib/twocohom.gd",
"../../lib/type.g",
"../../lib/type.gd",
"../../lib/type.gi",
"../../lib/type1.g",
"../../lib/unknown.gd",
"../../lib/upoly.gd",
Expand Down
1 change: 1 addition & 0 deletions doc/ref/types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ as well as sections&nbsp;<Ref Sect="Logical Implications"/>,
</ManSection>

<#Include Label="ShowImpliedFilters">
<#Include Label="FiltersType">

</Section>

Expand Down
1 change: 1 addition & 0 deletions lib/read3.g
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
##
#X now read all the definition parts
##
ReadLib( "type.gd" );
ReadLib( "tuples.gd" );
ReadLib( "rvecempt.gd" );

Expand Down
40 changes: 40 additions & 0 deletions lib/type.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#############################################################################
##
#W type.gd GAP library
##
##
#Y Copyright (C) 1997, Lehrstuhl D für Mathematik, RWTH Aachen, Germany
#Y (C) 1998 School Math and Comp. Sci., University of St Andrews, Scotland
#Y Copyright (C) 2002 The GAP Group
##
## This file implements some additional functions relating to types and
## families.
##

#############################################################################
##
#O FiltersType( <type> )
#O FiltersObj( <type> )
##
## list of filters of a type
##
## <#GAPDoc Label="FiltersType">
## <ManSection>
## <Oper Name="FiltersType" Arg='type'/>
## <Oper Name="FiltersObj" Arg='object'/>
##
## <Description>
## returns a list of the filters in the type <A>type</A>, or in the
## type of the object <A>object</A> respectively.
## <Example><![CDATA[
## gap> FiltersObj(fail);
## [ <Category "IsBool">, <Representation "IsInternalRep"> ]
## gap> FiltersType(TypeOfTypes);
## [ <Representation "IsPositionalObjectRep">, <Category "IsType">, <Representation "IsTypeDefaultRep"> ]
## ]]></Example>
## </Description>
## </ManSection>
## <#/GAPDoc>
##
DeclareOperation( "FiltersType", [ IsType ] );
DeclareOperation( "FiltersObj", [ IsObject ] );
18 changes: 18 additions & 0 deletions lib/type.gi
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,24 @@
## families.
##

#############################################################################
##
#M FiltersType( <type> )
##
## Return list of filters set in the type
##
InstallMethod(FiltersType, "for a type", [ IsType ],
type -> FILTERS{ TRUES_FLAGS(type![2]) });

#############################################################################
##
#M FiltersObj( <object> )
##
## Return list of filters set in the type
##
InstallMethod(FiltersObj, "for an object", [ IsObject ],
obj -> FiltersType(TypeObj(obj)));

#############################################################################
##
#M NamesFilterShort( flags, max )
Expand Down

0 comments on commit c06046c

Please sign in to comment.