Skip to content

Commit

Permalink
Merge pull request #24 from zickgraf/master
Browse files Browse the repository at this point in the history
Use FunctionWithNamedArguments
  • Loading branch information
zickgraf committed Feb 19, 2024
2 parents 7909f04 + 4d0307e commit dad17a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SetPackageInfo( rec(

PackageName := "ZXCalculusForCAP",
Subtitle := "The category of ZX-diagrams",
Version := "2024.01-01",
Version := "2024.02-01",
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
14 changes: 9 additions & 5 deletions gap/CategoryOfZXDiagrams.gi
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,14 @@ BindGlobal( "ZX_RemovedInnerNeutralNodes", function ( tuple )

end );

InstallGlobalFunction( CategoryOfZXDiagrams, function ( )
local ZX;
InstallGlobalFunction( CategoryOfZXDiagrams, FunctionWithNamedArguments(
[
[ "no_precompiled_code", false ],
],
function ( CAP_NAMED_ARGUMENTS )
local ZX;

if ValueOption( "no_precompiled_code" ) = true then
if CAP_NAMED_ARGUMENTS.no_precompiled_code then

if IsPackageMarkedForLoading( "FunctorCategories", ">= 2023.07-01" ) then

Expand All @@ -230,7 +234,7 @@ InstallGlobalFunction( CategoryOfZXDiagrams, function ( )

fi;

if ValueOption( "no_precompiled_code" ) <> true then
if not CAP_NAMED_ARGUMENTS.no_precompiled_code then

ADD_FUNCTIONS_FOR_CategoryOfZXDiagrams_precompiled( ZX );

Expand All @@ -240,7 +244,7 @@ InstallGlobalFunction( CategoryOfZXDiagrams, function ( )

return ZX;

end );
end ) );

##
InstallMethod( ViewString,
Expand Down

0 comments on commit dad17a8

Please sign in to comment.