diff --git a/lib/oper1.g b/lib/oper1.g index 66861e99cca..2d7ac7c4e4a 100644 --- a/lib/oper1.g +++ b/lib/oper1.g @@ -389,7 +389,7 @@ BIND_GLOBAL( "INSTALL_METHOD", rank, method, oreqs, - req, reqs, match, j, k, imp, notmatch, lk; + req, reqs, match, j, k, imp, notmatch, lk, funcname; if IsHPCGAP then # TODO: once the GAP compiler supports 'atomic', use that @@ -601,6 +601,27 @@ BIND_GLOBAL( "INSTALL_METHOD", fi; fi; + if IS_FUNCTION(method) and not HAS_NAME_FUNC(method) then + funcname := SHALLOW_COPY_OBJ(NAME_FUNC(opr)); + APPEND_LIST_INTR(funcname, " "); + if info <> false then + APPEND_LIST_INTR(funcname, info); + else + APPEND_LIST_INTR(funcname, "method"); + fi; + SET_NAME_FUNC(method, funcname); + fi; + + if IS_FUNCTION(rank) and not HAS_NAME_FUNC(rank) then + funcname := "Priority calculation for "; + APPEND_LIST_INTR(funcname, NAME_FUNC(opr)); + if info <> false then + APPEND_LIST_INTR(funcname, " "); + APPEND_LIST_INTR(funcname, info); + fi; + SET_NAME_FUNC(rank, funcname); + fi; + # Install the method in the operation. INSTALL_METHOD_FLAGS( opr, info, rel, flags, rank, method ); diff --git a/src/c_oper1.c b/src/c_oper1.c index a26938b4f33..18e30d361eb 100644 --- a/src/c_oper1.c +++ b/src/c_oper1.c @@ -1,7 +1,7 @@ #ifndef AVOID_PRECOMPILED /* C file produced by GAC */ #include "compiled.h" -#define FILE_CRC "127678438" +#define FILE_CRC "-102102092" /* global variables used in handlers */ static GVar G_REREADING; @@ -16,6 +16,10 @@ static GVar G_IS__FUNCTION; static Obj GF_IS__FUNCTION; static GVar G_NAME__FUNC; static Obj GF_NAME__FUNC; +static GVar G_HAS__NAME__FUNC; +static Obj GF_HAS__NAME__FUNC; +static GVar G_SET__NAME__FUNC; +static Obj GF_SET__NAME__FUNC; static GVar G_NARG__FUNC; static Obj GF_NARG__FUNC; static GVar G_IS__OPERATION; @@ -1360,6 +1364,7 @@ static Obj HdlrFunc6 ( Obj l_imp = 0; Obj l_notmatch = 0; Obj l_lk = 0; + Obj l_funcname = 0; Obj t_1 = 0; Obj t_2 = 0; Obj t_3 = 0; @@ -1392,6 +1397,7 @@ static Obj HdlrFunc6 ( (void)l_imp; (void)l_notmatch; (void)l_lk; + (void)l_funcname; Bag oldFrame; /* allocate new stack frame */ @@ -2365,9 +2371,113 @@ static Obj HdlrFunc6 ( } /* fi */ + /* if IS_FUNCTION( method ) and not HAS_NAME_FUNC( method ) then */ + t_4 = GF_IS__FUNCTION; + t_3 = CALL_1ARGS( t_4, l_method ); + CHECK_FUNC_RESULT( t_3 ) + CHECK_BOOL( t_3 ) + t_2 = (Obj)(UInt)(t_3 != False); + t_1 = t_2; + if ( t_1 ) { + t_6 = GF_HAS__NAME__FUNC; + t_5 = CALL_1ARGS( t_6, l_method ); + CHECK_FUNC_RESULT( t_5 ) + CHECK_BOOL( t_5 ) + t_4 = (Obj)(UInt)(t_5 != False); + t_3 = (Obj)(UInt)( ! ((Int)t_4) ); + t_1 = t_3; + } + if ( t_1 ) { + + /* funcname := SHALLOW_COPY_OBJ( NAME_FUNC( opr ) ); */ + t_2 = GF_SHALLOW__COPY__OBJ; + t_4 = GF_NAME__FUNC; + t_3 = CALL_1ARGS( t_4, l_opr ); + CHECK_FUNC_RESULT( t_3 ) + t_1 = CALL_1ARGS( t_2, t_3 ); + CHECK_FUNC_RESULT( t_1 ) + l_funcname = t_1; + + /* if info <> false then */ + t_2 = False; + t_1 = (Obj)(UInt)( ! EQ( l_info, t_2 )); + if ( t_1 ) { + + /* APPEND_LIST_INTR( funcname, " " ); */ + t_1 = GF_APPEND__LIST__INTR; + t_2 = MakeString( " " ); + CALL_2ARGS( t_1, l_funcname, t_2 ); + + /* APPEND_LIST_INTR( funcname, info ); */ + t_1 = GF_APPEND__LIST__INTR; + CALL_2ARGS( t_1, l_funcname, l_info ); + + } + /* fi */ + + /* SET_NAME_FUNC( method, funcname ); */ + t_1 = GF_SET__NAME__FUNC; + CALL_2ARGS( t_1, l_method, l_funcname ); + + } + /* fi */ + + /* if IS_FUNCTION( rank ) and not HAS_NAME_FUNC( rank ) then */ + t_4 = GF_IS__FUNCTION; + CHECK_BOUND( l_rank, "rank" ) + t_3 = CALL_1ARGS( t_4, l_rank ); + CHECK_FUNC_RESULT( t_3 ) + CHECK_BOOL( t_3 ) + t_2 = (Obj)(UInt)(t_3 != False); + t_1 = t_2; + if ( t_1 ) { + t_6 = GF_HAS__NAME__FUNC; + t_5 = CALL_1ARGS( t_6, l_rank ); + CHECK_FUNC_RESULT( t_5 ) + CHECK_BOOL( t_5 ) + t_4 = (Obj)(UInt)(t_5 != False); + t_3 = (Obj)(UInt)( ! ((Int)t_4) ); + t_1 = t_3; + } + if ( t_1 ) { + + /* funcname := "Priority calculation for "; */ + t_1 = MakeString( "Priority calculation for " ); + l_funcname = t_1; + + /* APPEND_LIST_INTR( funcname, NAME_FUNC( opr ) ); */ + t_1 = GF_APPEND__LIST__INTR; + t_3 = GF_NAME__FUNC; + t_2 = CALL_1ARGS( t_3, l_opr ); + CHECK_FUNC_RESULT( t_2 ) + CALL_2ARGS( t_1, l_funcname, t_2 ); + + /* if info <> false then */ + t_2 = False; + t_1 = (Obj)(UInt)( ! EQ( l_info, t_2 )); + if ( t_1 ) { + + /* APPEND_LIST_INTR( funcname, " " ); */ + t_1 = GF_APPEND__LIST__INTR; + t_2 = MakeString( " " ); + CALL_2ARGS( t_1, l_funcname, t_2 ); + + /* APPEND_LIST_INTR( funcname, info ); */ + t_1 = GF_APPEND__LIST__INTR; + CALL_2ARGS( t_1, l_funcname, l_info ); + + } + /* fi */ + + /* SET_NAME_FUNC( rank, funcname ); */ + t_1 = GF_SET__NAME__FUNC; + CALL_2ARGS( t_1, l_rank, l_funcname ); + + } + /* fi */ + /* INSTALL_METHOD_FLAGS( opr, info, rel, flags, rank, method ); */ t_1 = GF_INSTALL__METHOD__FLAGS; - CHECK_BOUND( l_rank, "rank" ) CALL_6ARGS( t_1, l_opr, l_info, l_rel, l_flags, l_rank, l_method ); /* return; */ @@ -2727,8 +2837,8 @@ static Obj HdlrFunc7 ( t_6 = NewFunction( NameFunc[8], 1, ArgStringToList("obj"), HdlrFunc8 ); SET_ENVI_FUNC( t_6, STATE(CurrLVars) ); t_7 = NewFunctionBody(); - SET_STARTLINE_BODY(t_7, 671); - SET_ENDLINE_BODY(t_7, 689); + SET_STARTLINE_BODY(t_7, 690); + SET_ENDLINE_BODY(t_7, 708); SET_FILENAME_BODY(t_7, FileName); SET_BODY_FUNC(t_6, t_7); CALL_6ARGS( t_1, t_2, t_3, t_4, t_5, l_rank, t_6 ); @@ -3293,8 +3403,8 @@ static Obj HdlrFunc11 ( t_1 = NewFunction( NameFunc[12], 1, ArgStringToList("key"), HdlrFunc12 ); SET_ENVI_FUNC( t_1, STATE(CurrLVars) ); t_2 = NewFunctionBody(); - SET_STARTLINE_BODY(t_2, 868); - SET_ENDLINE_BODY(t_2, 872); + SET_STARTLINE_BODY(t_2, 887); + SET_ENDLINE_BODY(t_2, 891); SET_FILENAME_BODY(t_2, FileName); SET_BODY_FUNC(t_1, t_2); ASS_LVAR( 2, t_1 ); @@ -3372,8 +3482,8 @@ static Obj HdlrFunc11 ( t_6 = NewFunction( NameFunc[13], 1, ArgStringToList("D"), HdlrFunc13 ); SET_ENVI_FUNC( t_6, STATE(CurrLVars) ); t_7 = NewFunctionBody(); - SET_STARTLINE_BODY(t_7, 889); - SET_ENDLINE_BODY(t_7, 889); + SET_STARTLINE_BODY(t_7, 908); + SET_ENDLINE_BODY(t_7, 908); SET_FILENAME_BODY(t_7, FileName); SET_BODY_FUNC(t_6, t_7); CALL_6ARGS( t_1, t_2, t_3, t_4, t_5, INTOBJ_INT(0), t_6 ); @@ -3434,8 +3544,8 @@ static Obj HdlrFunc11 ( t_6 = NewFunction( NameFunc[14], 2, ArgStringToList("D,key"), HdlrFunc14 ); SET_ENVI_FUNC( t_6, STATE(CurrLVars) ); t_7 = NewFunctionBody(); - SET_STARTLINE_BODY(t_7, 911); - SET_ENDLINE_BODY(t_7, 934); + SET_STARTLINE_BODY(t_7, 930); + SET_ENDLINE_BODY(t_7, 953); SET_FILENAME_BODY(t_7, FileName); SET_BODY_FUNC(t_6, t_7); CALL_6ARGS( t_1, t_2, t_3, t_4, t_5, INTOBJ_INT(0), t_6 ); @@ -3482,8 +3592,8 @@ static Obj HdlrFunc11 ( t_6 = NewFunction( NameFunc[15], 2, ArgStringToList("D,key"), HdlrFunc15 ); SET_ENVI_FUNC( t_6, STATE(CurrLVars) ); t_7 = NewFunctionBody(); - SET_STARTLINE_BODY(t_7, 944); - SET_ENDLINE_BODY(t_7, 952); + SET_STARTLINE_BODY(t_7, 963); + SET_ENDLINE_BODY(t_7, 971); SET_FILENAME_BODY(t_7, FileName); SET_BODY_FUNC(t_6, t_7); CALL_6ARGS( t_1, t_2, t_3, t_4, t_5, INTOBJ_INT(0), t_6 ); @@ -3543,8 +3653,8 @@ static Obj HdlrFunc11 ( t_6 = NewFunction( NameFunc[16], 3, ArgStringToList("D,key,obj"), HdlrFunc16 ); SET_ENVI_FUNC( t_6, STATE(CurrLVars) ); t_7 = NewFunctionBody(); - SET_STARTLINE_BODY(t_7, 961); - SET_ENDLINE_BODY(t_7, 974); + SET_STARTLINE_BODY(t_7, 980); + SET_ENDLINE_BODY(t_7, 993); SET_FILENAME_BODY(t_7, FileName); SET_BODY_FUNC(t_6, t_7); CALL_6ARGS( t_1, t_2, t_3, t_4, t_5, INTOBJ_INT(0), t_6 ); @@ -3905,8 +4015,8 @@ static Obj HdlrFunc17 ( t_4 = NewFunction( NameFunc[18], -1, ArgStringToList("arg"), HdlrFunc18 ); SET_ENVI_FUNC( t_4, STATE(CurrLVars) ); t_5 = NewFunctionBody(); - SET_STARTLINE_BODY(t_5, 1040); - SET_ENDLINE_BODY(t_5, 1056); + SET_STARTLINE_BODY(t_5, 1059); + SET_ENDLINE_BODY(t_5, 1075); SET_FILENAME_BODY(t_5, FileName); SET_BODY_FUNC(t_4, t_5); CALL_6ARGS( t_1, t_2, l_info, l_fampred, t_3, l_val, t_4 ); @@ -4156,7 +4266,7 @@ static Obj HdlrFunc1 ( AssGVar( G_INSTALL__METHOD, 0 ); /* BIND_GLOBAL( "INSTALL_METHOD", function ( arglist, check ) - local len, opr, info, pos, rel, filters, info1, isstr, flags, i, rank, method, oreqs, req, reqs, match, j, k, imp, notmatch, lk; + local len, opr, info, pos, rel, filters, info1, isstr, flags, i, rank, method, oreqs, req, reqs, match, j, k, imp, notmatch, lk, funcname; ; len := LEN_LIST( arglist ); if len < 3 then @@ -4301,6 +4411,23 @@ static Obj HdlrFunc1 ( od; fi; fi; + if IS_FUNCTION( method ) and not HAS_NAME_FUNC( method ) then + funcname := SHALLOW_COPY_OBJ( NAME_FUNC( opr ) ); + if info <> false then + APPEND_LIST_INTR( funcname, " " ); + APPEND_LIST_INTR( funcname, info ); + fi; + SET_NAME_FUNC( method, funcname ); + fi; + if IS_FUNCTION( rank ) and not HAS_NAME_FUNC( rank ) then + funcname := "Priority calculation for "; + APPEND_LIST_INTR( funcname, NAME_FUNC( opr ) ); + if info <> false then + APPEND_LIST_INTR( funcname, " " ); + APPEND_LIST_INTR( funcname, info ); + fi; + SET_NAME_FUNC( rank, funcname ); + fi; INSTALL_METHOD_FLAGS( opr, info, rel, flags, rank, method ); ; return; @@ -4311,7 +4438,7 @@ static Obj HdlrFunc1 ( SET_ENVI_FUNC( t_3, STATE(CurrLVars) ); t_4 = NewFunctionBody(); SET_STARTLINE_BODY(t_4, 378); - SET_ENDLINE_BODY(t_4, 610); + SET_ENDLINE_BODY(t_4, 629); SET_FILENAME_BODY(t_4, FileName); SET_BODY_FUNC(t_3, t_4); CALL_2ARGS( t_1, t_2, t_3 ); @@ -4368,8 +4495,8 @@ static Obj HdlrFunc1 ( t_2 = NewFunction( NameFunc[7], 6, ArgStringToList("name,filter,getter,setter,tester,mutflag"), HdlrFunc7 ); SET_ENVI_FUNC( t_2, STATE(CurrLVars) ); t_3 = NewFunctionBody(); - SET_STARTLINE_BODY(t_3, 629); - SET_ENDLINE_BODY(t_3, 693); + SET_STARTLINE_BODY(t_3, 648); + SET_ENDLINE_BODY(t_3, 712); SET_FILENAME_BODY(t_3, FileName); SET_BODY_FUNC(t_2, t_3); CALL_1ARGS( t_1, t_2 ); @@ -4382,8 +4509,8 @@ static Obj HdlrFunc1 ( t_2 = NewFunction( NameFunc[9], 6, ArgStringToList("name,filter,getter,setter,tester,mutflag"), HdlrFunc9 ); SET_ENVI_FUNC( t_2, STATE(CurrLVars) ); t_3 = NewFunctionBody(); - SET_STARTLINE_BODY(t_3, 696); - SET_ENDLINE_BODY(t_3, 702); + SET_STARTLINE_BODY(t_3, 715); + SET_ENDLINE_BODY(t_3, 721); SET_FILENAME_BODY(t_3, FileName); SET_BODY_FUNC(t_2, t_3); CALL_1ARGS( t_1, t_2 ); @@ -4410,8 +4537,8 @@ static Obj HdlrFunc1 ( t_3 = NewFunction( NameFunc[10], 2, ArgStringToList("list,elm"), HdlrFunc10 ); SET_ENVI_FUNC( t_3, STATE(CurrLVars) ); t_4 = NewFunctionBody(); - SET_STARTLINE_BODY(t_4, 715); - SET_ENDLINE_BODY(t_4, 739); + SET_STARTLINE_BODY(t_4, 734); + SET_ENDLINE_BODY(t_4, 758); SET_FILENAME_BODY(t_4, FileName); SET_BODY_FUNC(t_3, t_4); CALL_2ARGS( t_1, t_2, t_3 ); @@ -4494,8 +4621,8 @@ static Obj HdlrFunc1 ( t_3 = NewFunction( NameFunc[11], 4, ArgStringToList("name,domreq,keyreq,keytest"), HdlrFunc11 ); SET_ENVI_FUNC( t_3, STATE(CurrLVars) ); t_4 = NewFunctionBody(); - SET_STARTLINE_BODY(t_4, 864); - SET_ENDLINE_BODY(t_4, 975); + SET_STARTLINE_BODY(t_4, 883); + SET_ENDLINE_BODY(t_4, 994); SET_FILENAME_BODY(t_4, FileName); SET_BODY_FUNC(t_3, t_4); CALL_2ARGS( t_1, t_2, t_3 ); @@ -4545,8 +4672,8 @@ static Obj HdlrFunc1 ( t_3 = NewFunction( NameFunc[17], -1, ArgStringToList("arg"), HdlrFunc17 ); SET_ENVI_FUNC( t_3, STATE(CurrLVars) ); t_4 = NewFunctionBody(); - SET_STARTLINE_BODY(t_4, 1010); - SET_ENDLINE_BODY(t_4, 1057); + SET_STARTLINE_BODY(t_4, 1029); + SET_ENDLINE_BODY(t_4, 1076); SET_FILENAME_BODY(t_4, FileName); SET_BODY_FUNC(t_3, t_4); CALL_2ARGS( t_1, t_2, t_3 ); @@ -4587,6 +4714,8 @@ static Int PostRestore ( StructInitInfo * module ) G_GAPInfo = GVarName( "GAPInfo" ); G_IS__FUNCTION = GVarName( "IS_FUNCTION" ); G_NAME__FUNC = GVarName( "NAME_FUNC" ); + G_HAS__NAME__FUNC = GVarName( "HAS_NAME_FUNC" ); + G_SET__NAME__FUNC = GVarName( "SET_NAME_FUNC" ); G_NARG__FUNC = GVarName( "NARG_FUNC" ); G_IS__OPERATION = GVarName( "IS_OPERATION" ); G_AINV = GVarName( "AINV" ); @@ -4704,6 +4833,8 @@ static Int InitKernel ( StructInitInfo * module ) InitCopyGVar( "GAPInfo", &GC_GAPInfo ); InitFopyGVar( "IS_FUNCTION", &GF_IS__FUNCTION ); InitFopyGVar( "NAME_FUNC", &GF_NAME__FUNC ); + InitFopyGVar( "HAS_NAME_FUNC", &GF_HAS__NAME__FUNC ); + InitFopyGVar( "SET_NAME_FUNC", &GF_SET__NAME__FUNC ); InitFopyGVar( "NARG_FUNC", &GF_NARG__FUNC ); InitFopyGVar( "IS_OPERATION", &GF_IS__OPERATION ); InitFopyGVar( "AINV", &GF_AINV ); @@ -4851,7 +4982,7 @@ static Int InitLibrary ( StructInitInfo * module ) static StructInitInfo module = { .type = MODULE_STATIC, .name = "GAPROOT/lib/oper1.g", - .crc = 127678438, + .crc = -102102092, .initKernel = InitKernel, .initLibrary = InitLibrary, .postRestore = PostRestore, diff --git a/src/hpc/c_oper1.c b/src/hpc/c_oper1.c index b378e5d6159..91b26f8e025 100644 --- a/src/hpc/c_oper1.c +++ b/src/hpc/c_oper1.c @@ -1,7 +1,7 @@ #ifndef AVOID_PRECOMPILED /* C file produced by GAC */ #include "compiled.h" -#define FILE_CRC "127678438" +#define FILE_CRC "-102102092" /* global variables used in handlers */ static GVar G_REREADING; @@ -16,6 +16,10 @@ static GVar G_IS__FUNCTION; static Obj GF_IS__FUNCTION; static GVar G_NAME__FUNC; static Obj GF_NAME__FUNC; +static GVar G_HAS__NAME__FUNC; +static Obj GF_HAS__NAME__FUNC; +static GVar G_SET__NAME__FUNC; +static Obj GF_SET__NAME__FUNC; static GVar G_NARG__FUNC; static Obj GF_NARG__FUNC; static GVar G_IS__OPERATION; @@ -1399,6 +1403,7 @@ static Obj HdlrFunc6 ( Obj l_imp = 0; Obj l_notmatch = 0; Obj l_lk = 0; + Obj l_funcname = 0; Obj t_1 = 0; Obj t_2 = 0; Obj t_3 = 0; @@ -1431,6 +1436,7 @@ static Obj HdlrFunc6 ( (void)l_imp; (void)l_notmatch; (void)l_lk; + (void)l_funcname; Bag oldFrame; /* allocate new stack frame */ @@ -2412,9 +2418,113 @@ static Obj HdlrFunc6 ( } /* fi */ + /* if IS_FUNCTION( method ) and not HAS_NAME_FUNC( method ) then */ + t_4 = GF_IS__FUNCTION; + t_3 = CALL_1ARGS( t_4, l_method ); + CHECK_FUNC_RESULT( t_3 ) + CHECK_BOOL( t_3 ) + t_2 = (Obj)(UInt)(t_3 != False); + t_1 = t_2; + if ( t_1 ) { + t_6 = GF_HAS__NAME__FUNC; + t_5 = CALL_1ARGS( t_6, l_method ); + CHECK_FUNC_RESULT( t_5 ) + CHECK_BOOL( t_5 ) + t_4 = (Obj)(UInt)(t_5 != False); + t_3 = (Obj)(UInt)( ! ((Int)t_4) ); + t_1 = t_3; + } + if ( t_1 ) { + + /* funcname := SHALLOW_COPY_OBJ( NAME_FUNC( opr ) ); */ + t_2 = GF_SHALLOW__COPY__OBJ; + t_4 = GF_NAME__FUNC; + t_3 = CALL_1ARGS( t_4, l_opr ); + CHECK_FUNC_RESULT( t_3 ) + t_1 = CALL_1ARGS( t_2, t_3 ); + CHECK_FUNC_RESULT( t_1 ) + l_funcname = t_1; + + /* if info <> false then */ + t_2 = False; + t_1 = (Obj)(UInt)( ! EQ( l_info, t_2 )); + if ( t_1 ) { + + /* APPEND_LIST_INTR( funcname, " " ); */ + t_1 = GF_APPEND__LIST__INTR; + t_2 = MakeString( " " ); + CALL_2ARGS( t_1, l_funcname, t_2 ); + + /* APPEND_LIST_INTR( funcname, info ); */ + t_1 = GF_APPEND__LIST__INTR; + CALL_2ARGS( t_1, l_funcname, l_info ); + + } + /* fi */ + + /* SET_NAME_FUNC( method, funcname ); */ + t_1 = GF_SET__NAME__FUNC; + CALL_2ARGS( t_1, l_method, l_funcname ); + + } + /* fi */ + + /* if IS_FUNCTION( rank ) and not HAS_NAME_FUNC( rank ) then */ + t_4 = GF_IS__FUNCTION; + CHECK_BOUND( l_rank, "rank" ) + t_3 = CALL_1ARGS( t_4, l_rank ); + CHECK_FUNC_RESULT( t_3 ) + CHECK_BOOL( t_3 ) + t_2 = (Obj)(UInt)(t_3 != False); + t_1 = t_2; + if ( t_1 ) { + t_6 = GF_HAS__NAME__FUNC; + t_5 = CALL_1ARGS( t_6, l_rank ); + CHECK_FUNC_RESULT( t_5 ) + CHECK_BOOL( t_5 ) + t_4 = (Obj)(UInt)(t_5 != False); + t_3 = (Obj)(UInt)( ! ((Int)t_4) ); + t_1 = t_3; + } + if ( t_1 ) { + + /* funcname := "Priority calculation for "; */ + t_1 = MakeString( "Priority calculation for " ); + l_funcname = t_1; + + /* APPEND_LIST_INTR( funcname, NAME_FUNC( opr ) ); */ + t_1 = GF_APPEND__LIST__INTR; + t_3 = GF_NAME__FUNC; + t_2 = CALL_1ARGS( t_3, l_opr ); + CHECK_FUNC_RESULT( t_2 ) + CALL_2ARGS( t_1, l_funcname, t_2 ); + + /* if info <> false then */ + t_2 = False; + t_1 = (Obj)(UInt)( ! EQ( l_info, t_2 )); + if ( t_1 ) { + + /* APPEND_LIST_INTR( funcname, " " ); */ + t_1 = GF_APPEND__LIST__INTR; + t_2 = MakeString( " " ); + CALL_2ARGS( t_1, l_funcname, t_2 ); + + /* APPEND_LIST_INTR( funcname, info ); */ + t_1 = GF_APPEND__LIST__INTR; + CALL_2ARGS( t_1, l_funcname, l_info ); + + } + /* fi */ + + /* SET_NAME_FUNC( rank, funcname ); */ + t_1 = GF_SET__NAME__FUNC; + CALL_2ARGS( t_1, l_rank, l_funcname ); + + } + /* fi */ + /* INSTALL_METHOD_FLAGS( opr, info, rel, flags, rank, method ); */ t_1 = GF_INSTALL__METHOD__FLAGS; - CHECK_BOUND( l_rank, "rank" ) CALL_6ARGS( t_1, l_opr, l_info, l_rel, l_flags, l_rank, l_method ); /* UNLOCK( lk ); */ @@ -2790,8 +2900,8 @@ static Obj HdlrFunc7 ( t_6 = NewFunction( NameFunc[8], 1, ArgStringToList("obj"), HdlrFunc8 ); SET_ENVI_FUNC( t_6, STATE(CurrLVars) ); t_7 = NewFunctionBody(); - SET_STARTLINE_BODY(t_7, 671); - SET_ENDLINE_BODY(t_7, 689); + SET_STARTLINE_BODY(t_7, 690); + SET_ENDLINE_BODY(t_7, 708); SET_FILENAME_BODY(t_7, FileName); SET_BODY_FUNC(t_6, t_7); CALL_6ARGS( t_1, t_2, t_3, t_4, t_5, l_rank, t_6 ); @@ -3356,8 +3466,8 @@ static Obj HdlrFunc11 ( t_1 = NewFunction( NameFunc[12], 1, ArgStringToList("key"), HdlrFunc12 ); SET_ENVI_FUNC( t_1, STATE(CurrLVars) ); t_2 = NewFunctionBody(); - SET_STARTLINE_BODY(t_2, 868); - SET_ENDLINE_BODY(t_2, 872); + SET_STARTLINE_BODY(t_2, 887); + SET_ENDLINE_BODY(t_2, 891); SET_FILENAME_BODY(t_2, FileName); SET_BODY_FUNC(t_1, t_2); ASS_LVAR( 2, t_1 ); @@ -3435,8 +3545,8 @@ static Obj HdlrFunc11 ( t_6 = NewFunction( NameFunc[13], 1, ArgStringToList("D"), HdlrFunc13 ); SET_ENVI_FUNC( t_6, STATE(CurrLVars) ); t_7 = NewFunctionBody(); - SET_STARTLINE_BODY(t_7, 889); - SET_ENDLINE_BODY(t_7, 889); + SET_STARTLINE_BODY(t_7, 908); + SET_ENDLINE_BODY(t_7, 908); SET_FILENAME_BODY(t_7, FileName); SET_BODY_FUNC(t_6, t_7); CALL_6ARGS( t_1, t_2, t_3, t_4, t_5, INTOBJ_INT(0), t_6 ); @@ -3509,8 +3619,8 @@ static Obj HdlrFunc11 ( t_6 = NewFunction( NameFunc[14], 2, ArgStringToList("D,key"), HdlrFunc14 ); SET_ENVI_FUNC( t_6, STATE(CurrLVars) ); t_7 = NewFunctionBody(); - SET_STARTLINE_BODY(t_7, 911); - SET_ENDLINE_BODY(t_7, 934); + SET_STARTLINE_BODY(t_7, 930); + SET_ENDLINE_BODY(t_7, 953); SET_FILENAME_BODY(t_7, FileName); SET_BODY_FUNC(t_6, t_7); CALL_6ARGS( t_1, t_2, t_3, t_4, t_5, INTOBJ_INT(0), t_6 ); @@ -3557,8 +3667,8 @@ static Obj HdlrFunc11 ( t_6 = NewFunction( NameFunc[15], 2, ArgStringToList("D,key"), HdlrFunc15 ); SET_ENVI_FUNC( t_6, STATE(CurrLVars) ); t_7 = NewFunctionBody(); - SET_STARTLINE_BODY(t_7, 944); - SET_ENDLINE_BODY(t_7, 952); + SET_STARTLINE_BODY(t_7, 963); + SET_ENDLINE_BODY(t_7, 971); SET_FILENAME_BODY(t_7, FileName); SET_BODY_FUNC(t_6, t_7); CALL_6ARGS( t_1, t_2, t_3, t_4, t_5, INTOBJ_INT(0), t_6 ); @@ -3618,8 +3728,8 @@ static Obj HdlrFunc11 ( t_6 = NewFunction( NameFunc[16], 3, ArgStringToList("D,key,obj"), HdlrFunc16 ); SET_ENVI_FUNC( t_6, STATE(CurrLVars) ); t_7 = NewFunctionBody(); - SET_STARTLINE_BODY(t_7, 961); - SET_ENDLINE_BODY(t_7, 974); + SET_STARTLINE_BODY(t_7, 980); + SET_ENDLINE_BODY(t_7, 993); SET_FILENAME_BODY(t_7, FileName); SET_BODY_FUNC(t_6, t_7); CALL_6ARGS( t_1, t_2, t_3, t_4, t_5, INTOBJ_INT(0), t_6 ); @@ -3980,8 +4090,8 @@ static Obj HdlrFunc17 ( t_4 = NewFunction( NameFunc[18], -1, ArgStringToList("arg"), HdlrFunc18 ); SET_ENVI_FUNC( t_4, STATE(CurrLVars) ); t_5 = NewFunctionBody(); - SET_STARTLINE_BODY(t_5, 1040); - SET_ENDLINE_BODY(t_5, 1056); + SET_STARTLINE_BODY(t_5, 1059); + SET_ENDLINE_BODY(t_5, 1075); SET_FILENAME_BODY(t_5, FileName); SET_BODY_FUNC(t_4, t_5); CALL_6ARGS( t_1, t_2, l_info, l_fampred, t_3, l_val, t_4 ); @@ -4241,7 +4351,7 @@ static Obj HdlrFunc1 ( AssGVar( G_INSTALL__METHOD, 0 ); /* BIND_GLOBAL( "INSTALL_METHOD", function ( arglist, check ) - local len, opr, info, pos, rel, filters, info1, isstr, flags, i, rank, method, oreqs, req, reqs, match, j, k, imp, notmatch, lk; + local len, opr, info, pos, rel, filters, info1, isstr, flags, i, rank, method, oreqs, req, reqs, match, j, k, imp, notmatch, lk, funcname; lk := READ_LOCK( OPERATIONS_REGION ); len := LEN_LIST( arglist ); if len < 3 then @@ -4386,6 +4496,23 @@ static Obj HdlrFunc1 ( od; fi; fi; + if IS_FUNCTION( method ) and not HAS_NAME_FUNC( method ) then + funcname := SHALLOW_COPY_OBJ( NAME_FUNC( opr ) ); + if info <> false then + APPEND_LIST_INTR( funcname, " " ); + APPEND_LIST_INTR( funcname, info ); + fi; + SET_NAME_FUNC( method, funcname ); + fi; + if IS_FUNCTION( rank ) and not HAS_NAME_FUNC( rank ) then + funcname := "Priority calculation for "; + APPEND_LIST_INTR( funcname, NAME_FUNC( opr ) ); + if info <> false then + APPEND_LIST_INTR( funcname, " " ); + APPEND_LIST_INTR( funcname, info ); + fi; + SET_NAME_FUNC( rank, funcname ); + fi; INSTALL_METHOD_FLAGS( opr, info, rel, flags, rank, method ); UNLOCK( lk ); return; @@ -4396,7 +4523,7 @@ static Obj HdlrFunc1 ( SET_ENVI_FUNC( t_3, STATE(CurrLVars) ); t_4 = NewFunctionBody(); SET_STARTLINE_BODY(t_4, 378); - SET_ENDLINE_BODY(t_4, 610); + SET_ENDLINE_BODY(t_4, 629); SET_FILENAME_BODY(t_4, FileName); SET_BODY_FUNC(t_3, t_4); CALL_2ARGS( t_1, t_2, t_3 ); @@ -4453,8 +4580,8 @@ static Obj HdlrFunc1 ( t_2 = NewFunction( NameFunc[7], 6, ArgStringToList("name,filter,getter,setter,tester,mutflag"), HdlrFunc7 ); SET_ENVI_FUNC( t_2, STATE(CurrLVars) ); t_3 = NewFunctionBody(); - SET_STARTLINE_BODY(t_3, 629); - SET_ENDLINE_BODY(t_3, 693); + SET_STARTLINE_BODY(t_3, 648); + SET_ENDLINE_BODY(t_3, 712); SET_FILENAME_BODY(t_3, FileName); SET_BODY_FUNC(t_2, t_3); CALL_1ARGS( t_1, t_2 ); @@ -4467,8 +4594,8 @@ static Obj HdlrFunc1 ( t_2 = NewFunction( NameFunc[9], 6, ArgStringToList("name,filter,getter,setter,tester,mutflag"), HdlrFunc9 ); SET_ENVI_FUNC( t_2, STATE(CurrLVars) ); t_3 = NewFunctionBody(); - SET_STARTLINE_BODY(t_3, 696); - SET_ENDLINE_BODY(t_3, 702); + SET_STARTLINE_BODY(t_3, 715); + SET_ENDLINE_BODY(t_3, 721); SET_FILENAME_BODY(t_3, FileName); SET_BODY_FUNC(t_2, t_3); CALL_1ARGS( t_1, t_2 ); @@ -4495,8 +4622,8 @@ static Obj HdlrFunc1 ( t_3 = NewFunction( NameFunc[10], 2, ArgStringToList("list,elm"), HdlrFunc10 ); SET_ENVI_FUNC( t_3, STATE(CurrLVars) ); t_4 = NewFunctionBody(); - SET_STARTLINE_BODY(t_4, 715); - SET_ENDLINE_BODY(t_4, 739); + SET_STARTLINE_BODY(t_4, 734); + SET_ENDLINE_BODY(t_4, 758); SET_FILENAME_BODY(t_4, FileName); SET_BODY_FUNC(t_3, t_4); CALL_2ARGS( t_1, t_2, t_3 ); @@ -4579,8 +4706,8 @@ static Obj HdlrFunc1 ( t_3 = NewFunction( NameFunc[11], 4, ArgStringToList("name,domreq,keyreq,keytest"), HdlrFunc11 ); SET_ENVI_FUNC( t_3, STATE(CurrLVars) ); t_4 = NewFunctionBody(); - SET_STARTLINE_BODY(t_4, 864); - SET_ENDLINE_BODY(t_4, 975); + SET_STARTLINE_BODY(t_4, 883); + SET_ENDLINE_BODY(t_4, 994); SET_FILENAME_BODY(t_4, FileName); SET_BODY_FUNC(t_3, t_4); CALL_2ARGS( t_1, t_2, t_3 ); @@ -4630,8 +4757,8 @@ static Obj HdlrFunc1 ( t_3 = NewFunction( NameFunc[17], -1, ArgStringToList("arg"), HdlrFunc17 ); SET_ENVI_FUNC( t_3, STATE(CurrLVars) ); t_4 = NewFunctionBody(); - SET_STARTLINE_BODY(t_4, 1010); - SET_ENDLINE_BODY(t_4, 1057); + SET_STARTLINE_BODY(t_4, 1029); + SET_ENDLINE_BODY(t_4, 1076); SET_FILENAME_BODY(t_4, FileName); SET_BODY_FUNC(t_3, t_4); CALL_2ARGS( t_1, t_2, t_3 ); @@ -4672,6 +4799,8 @@ static Int PostRestore ( StructInitInfo * module ) G_GAPInfo = GVarName( "GAPInfo" ); G_IS__FUNCTION = GVarName( "IS_FUNCTION" ); G_NAME__FUNC = GVarName( "NAME_FUNC" ); + G_HAS__NAME__FUNC = GVarName( "HAS_NAME_FUNC" ); + G_SET__NAME__FUNC = GVarName( "SET_NAME_FUNC" ); G_NARG__FUNC = GVarName( "NARG_FUNC" ); G_IS__OPERATION = GVarName( "IS_OPERATION" ); G_AINV = GVarName( "AINV" ); @@ -4797,6 +4926,8 @@ static Int InitKernel ( StructInitInfo * module ) InitCopyGVar( "GAPInfo", &GC_GAPInfo ); InitFopyGVar( "IS_FUNCTION", &GF_IS__FUNCTION ); InitFopyGVar( "NAME_FUNC", &GF_NAME__FUNC ); + InitFopyGVar( "HAS_NAME_FUNC", &GF_HAS__NAME__FUNC ); + InitFopyGVar( "SET_NAME_FUNC", &GF_SET__NAME__FUNC ); InitFopyGVar( "NARG_FUNC", &GF_NARG__FUNC ); InitFopyGVar( "IS_OPERATION", &GF_IS__OPERATION ); InitFopyGVar( "AINV", &GF_AINV ); @@ -4952,7 +5083,7 @@ static Int InitLibrary ( StructInitInfo * module ) static StructInitInfo module = { .type = MODULE_STATIC, .name = "GAPROOT/lib/oper1.g", - .crc = 127678438, + .crc = -102102092, .initKernel = InitKernel, .initLibrary = InitLibrary, .postRestore = PostRestore,