Skip to content

Commit 0ad3bf7

Browse files
avoid broken Add-methods in AttributeCategory
add *WithGiven* to no_install_list if object-part-operation is not supported by AttributeCategory
1 parent f603836 commit 0ad3bf7

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

AttributeCategoryForCAP/PackageInfo.g

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SetPackageInfo( rec(
1010

1111
PackageName := "AttributeCategoryForCAP",
1212
Subtitle := "Automatic enhancement with attributes of a CAP category",
13-
Version := "2023.02-02",
13+
Version := "2023.02-03",
1414
Date := Concatenation( "01/", ~.Version{[ 6, 7 ]}, "/", ~.Version{[ 1 .. 4 ]} ),
1515
License := "GPL-2.0-or-later",
1616

AttributeCategoryForCAP/gap/AttributeCategory.gi

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ InstallGlobalFunction( CAP_INTERNAL_INSTALL_ADDS_FOR_CATEGORY_WITH_ATTRIBUTES,
127127
create_function_morphism_no_new_object, create_function_morphism_new_source,
128128
create_function_morphism_new_range, attributes, recnames, name, func, pos, function_to_add, add_function,
129129
create_function_object_no_arguments, create_function_morphism_or_fail, with_given_object_name, entry,
130-
no_install_list, installed_operations_of_underlying_category;
130+
no_install_list, functorial, installed_operations_of_underlying_category;
131131

132132
category_with_attributes := structure_record.category_with_attributes;
133133

@@ -341,6 +341,43 @@ InstallGlobalFunction( CAP_INTERNAL_INSTALL_ADDS_FOR_CATEGORY_WITH_ATTRIBUTES,
341341

342342
fi;
343343

344+
## add *WithGiven* to no_install_list if object-part-operation is not supported by AttributeCategory
345+
for name in RecNames( CAP_INTERNAL_METHOD_NAME_RECORD ) do
346+
347+
if CAP_INTERNAL_METHOD_NAME_RECORD.(name).return_type = "object" and IsBound( CAP_INTERNAL_METHOD_NAME_RECORD.(name).functorial ) then
348+
349+
functorial := CAP_INTERNAL_METHOD_NAME_RECORD.(name).functorial;
350+
351+
if IsBound( CAP_INTERNAL_METHOD_NAME_RECORD.(functorial).with_given_without_given_name_pair ) then
352+
353+
functorial := CAP_INTERNAL_METHOD_NAME_RECORD.(functorial).with_given_without_given_name_pair;
354+
355+
if IsList( functorial ) and Length( functorial ) = 2 then
356+
357+
if not IsBound( structure_record.(name) ) and functorial[2] in recnames then
358+
359+
Add( no_install_list, functorial[2] );
360+
361+
fi;
362+
363+
fi;
364+
365+
fi;
366+
367+
elif CAP_INTERNAL_METHOD_NAME_RECORD.(name).return_type = "morphism" and IsBound( CAP_INTERNAL_METHOD_NAME_RECORD.(name).with_given_object_name ) then
368+
369+
with_given_object_name := CAP_INTERNAL_METHOD_NAME_RECORD.(name).with_given_object_name;
370+
371+
if not IsBound( structure_record.(with_given_object_name) ) and name in recnames then
372+
373+
Add( no_install_list, name );
374+
375+
fi;
376+
377+
fi;
378+
379+
od;
380+
344381
for func in no_install_list do
345382

346383
pos := Position( recnames, func );

0 commit comments

Comments
 (0)