diff --git a/src/ariths.c b/src/ariths.c index 99fbd7b268..8777b6ca8a 100644 --- a/src/ariths.c +++ b/src/ariths.c @@ -35,7 +35,7 @@ ArithMethod1 ZeroFuncs [LAST_REAL_TNUM+1]; ** *F ZeroObject( ) . . . . . . . . . . . . . . . . . . . . call methsel */ -Obj ZEROOp; +static Obj ZEROOp; Obj ZeroObject ( Obj obj ) @@ -71,7 +71,7 @@ Obj VerboseZeroObject ( ** *F InstallZeroObject( ) . . . . . . . . . . . . install zero methods */ -void InstallZeroObject ( Int verb ) +static void InstallZeroObject ( Int verb ) { UInt t1; /* type of left operand */ ArithMethod1 func; /* zero function */ @@ -105,7 +105,7 @@ ArithMethod1 ZeroMutFuncs [LAST_REAL_TNUM+1]; ** *F ZeroMutObject( ) . . . . . . . . . . . . . . . . . . . . call methsel */ -Obj ZeroOp; +static Obj ZeroOp; Obj ZeroMutObject ( Obj obj ) @@ -141,7 +141,7 @@ Obj VerboseZeroMutObject ( ** *F InstallZeroMutObject( ) . . . . . . . . . . . . install zero methods */ -void InstallZeroMutObject ( Int verb ) +static void InstallZeroMutObject ( Int verb ) { UInt t1; /* type of left operand */ ArithMethod1 func; /* zero function */ @@ -179,7 +179,7 @@ ArithMethod1 AInvMutFuncs[ LAST_REAL_TNUM + 1]; ** *F AInvObj( ) . . . . . . . . . . . . . . . . . . . . . call methsel */ -Obj AInvOp; +static Obj AInvOp; Obj AInvObject ( Obj obj ) @@ -213,7 +213,7 @@ Obj VerboseAInvObject ( ** *F InstallAinvObject( ) . . . . . . install additive inverse methods */ -void InstallAinvObject ( Int verb ) +static void InstallAinvObject ( Int verb ) { UInt t1; /* type of left operand */ ArithMethod1 func; /* ainv function */ @@ -240,7 +240,7 @@ Obj FuncAINV ( ** *F AInvMutObject( ) . .. . . . . . . . . . . . . . . . . call methsel */ -Obj AdditiveInverseOp; +static Obj AdditiveInverseOp; Obj AInvMutObject ( Obj obj ) @@ -274,7 +274,7 @@ Obj VerboseAInvMutObject ( ** *F InstallAinvMutObject( ) . . . . . . install additive inverse methods */ -void InstallAinvMutObject ( Int verb ) +static void InstallAinvMutObject ( Int verb ) { UInt t1; /* type of left operand */ ArithMethod1 func; /* ainv function */ @@ -309,7 +309,7 @@ ArithMethod1 OneFuncs [LAST_REAL_TNUM+1]; ** *F OneObject( ) . . . . . . . . . . . . . . . . . . . . call methsel */ -Obj OneOp; +static Obj OneOp; Obj OneObject ( Obj obj ) @@ -343,7 +343,7 @@ Obj VerboseOneObject ( ** *F InstallOneObject( ) . . . . . . . . . . . . . install one methods */ -void InstallOneObject ( Int verb ) +static void InstallOneObject ( Int verb ) { UInt t1; /* type of left operand */ ArithMethod1 func; /* one function */ @@ -377,7 +377,7 @@ ArithMethod1 OneMutFuncs [LAST_REAL_TNUM+1]; ** *F OneMutObject( ) . . . . . . . . . . . . . . . . . . . . call methsel */ -Obj OneMutOp; +static Obj OneMutOp; Obj OneMutObject ( Obj obj ) @@ -411,7 +411,7 @@ Obj VerboseOneMutObject ( ** *F InstallOneMutObject( ) . . . . . . . . . . . . . install one methods */ -void InstallOneMutObject ( Int verb ) +static void InstallOneMutObject ( Int verb ) { UInt t1; /* type of left operand */ ArithMethod1 func; /* one function */ @@ -446,7 +446,7 @@ ArithMethod1 InvFuncs [LAST_REAL_TNUM+1]; ** *F InvObject( ) . . . . . . . . . . . . . . . . . . . . call methsel */ -Obj InvOp; +static Obj InvOp; Obj InvObject ( Obj obj ) @@ -480,7 +480,7 @@ Obj VerboseInvObject ( ** *F InstallInvObject( ) . . . . . . . . . . . install inverse methods */ -void InstallInvObject ( Int verb ) +static void InstallInvObject ( Int verb ) { UInt t1; /* type of left operand */ ArithMethod1 func; /* inv function */ @@ -515,7 +515,7 @@ ArithMethod1 InvMutFuncs [LAST_REAL_TNUM+1]; ** *F InvMutObject( ) . . . . . . . . . . . . . . .. . . . . call methsel */ -Obj InvMutOp; +static Obj InvMutOp; Obj InvMutObject ( Obj obj ) @@ -549,7 +549,7 @@ Obj VerboseInvMutObject ( ** *F InstallInvMutObject( ) install mutability preserving inverse methods */ -void InstallInvMutObject ( Int verb ) +static void InstallInvMutObject ( Int verb ) { UInt t1; /* type of left operand */ ArithMethod1 func; /* inv function */ @@ -627,7 +627,7 @@ Int VerboseEqObject ( ** *F InstallEqObject( ) . . . . . . . . . . install comparison methods */ -void InstallEqObject ( Int verb ) +static void InstallEqObject ( Int verb ) { UInt t1; /* type of left operand */ UInt t2; /* type of right operand */ @@ -700,7 +700,7 @@ Int VerboseLtObject ( ** *F InstallLtObject( ) . . . . . . . . . . . install less than methods */ -void InstallLtObject ( Int verb ) +static void InstallLtObject ( Int verb ) { UInt t1; /* type of left operand */ UInt t2; /* type of right operand */ @@ -756,7 +756,7 @@ Int InUndefined ( ** *F InObject( , ) . . . . . . . . . . . . . . . . . call methsel */ -Obj InOper; +static Obj InOper; Int InObject ( Obj opL, @@ -782,7 +782,7 @@ Int VerboseInObject ( ** *F InstallInObject( ) . . . . . . . . . . . . . . install in methods */ -void InstallInObject ( Int verb ) +static void InstallInObject ( Int verb ) { UInt t1; /* type of left operand */ UInt t2; /* type of right operand */ @@ -863,7 +863,7 @@ Obj VerboseSumObject ( ** *F InstallSumObject( ) . . . . . . . . . . . . . install sum methods */ -void InstallSumObject ( Int verb ) +static void InstallSumObject ( Int verb ) { UInt t1; /* type of left operand */ UInt t2; /* type of right operand */ @@ -918,7 +918,7 @@ Obj DiffDefault ( ** *F DiffObject( , ) . . . . . . . . . . . . . . . . call methsel */ -Obj DiffOper; +static Obj DiffOper; Obj DiffObject ( Obj opL, @@ -954,7 +954,7 @@ Obj VerboseDiffObject ( ** *F InstallDiffObject( ) . . . . . . . . . install difference methods */ -void InstallDiffObject ( Int verb ) +static void InstallDiffObject ( Int verb ) { UInt t1; /* type of left operand */ UInt t2; /* type of right operand */ @@ -974,8 +974,6 @@ void InstallDiffObject ( Int verb ) ** *F FuncDIFF_DEFAULT( , , ) . . . . . . call 'DiffDefault' */ -Obj DiffDefaultFunc; - Obj FuncDIFF_DEFAULT ( Obj self, Obj opL, @@ -1009,7 +1007,7 @@ ArithMethod2 ProdFuncs [LAST_REAL_TNUM+1][LAST_REAL_TNUM+1]; ** *F ProdObject( , ) . . . . . . . . . . . . . . . . call methsel */ -Obj ProdOper; +static Obj ProdOper; Obj ProdObject ( Obj opL, @@ -1045,7 +1043,7 @@ Obj VerboseProdObject ( ** *F InstallProdObject( ) . . . . . . . . . . . install product methods */ -void InstallProdObject ( Int verb ) +static void InstallProdObject ( Int verb ) { UInt t1; /* type of left operand */ UInt t2; /* type of right operand */ @@ -1099,7 +1097,7 @@ Obj QuoDefault ( ** *F QuoObject( , ) . . . . . . . . . . . . . . . . . call methsel */ -Obj QuoOper; +static Obj QuoOper; Obj QuoObject ( Obj opL, @@ -1135,7 +1133,7 @@ Obj VerboseQuoObject ( ** *F InstallQuoObject( ) . . . . . . . . . . install quotient methods */ -void InstallQuoObject ( Int verb ) +static void InstallQuoObject ( Int verb ) { UInt t1; /* type of left operand */ UInt t2; /* type of right operand */ @@ -1155,8 +1153,6 @@ void InstallQuoObject ( Int verb ) ** *F FuncQUO_DEFAULT( , , ) . . . . . . . . call 'QuoDefault' */ -Obj QuoDefaultFunc; - Obj FuncQUO_DEFAULT ( Obj self, Obj opL, @@ -1204,7 +1200,7 @@ Obj LQuoDefault ( ** *F LQuoObject( , ) . . . . . . . . . . . . . . . . call methsel */ -Obj LQuoOper; +static Obj LQuoOper; Obj LQuoObject ( Obj opL, @@ -1240,7 +1236,7 @@ Obj VerboseLQuoObject ( ** *F InstallLQuoObject( ) . . . . . . . . install left quotient methods */ -void InstallLQuoObject ( Int verb ) +static void InstallLQuoObject ( Int verb ) { UInt t1; /* type of left operand */ UInt t2; /* type of right operand */ @@ -1260,8 +1256,6 @@ void InstallLQuoObject ( Int verb ) ** *F FuncLQUO_DEFAULT( , , ) . . . . . . call 'LQuoDefault' */ -Obj LQuoDefaultFunc; - Obj FuncLQUO_DEFAULT ( Obj self, Obj opL, @@ -1309,7 +1303,7 @@ Obj PowDefault ( ** *F PowObject( , ) . . . . . . . . . . . . . . . . . call methsel */ -Obj PowOper; +static Obj PowOper; Obj PowObject ( Obj opL, @@ -1346,7 +1340,7 @@ Obj VerbosePowObject ( ** *F InstallPowObject( ) . . . . . . . . . . install the power methods */ -void InstallPowObject ( Int verb ) +static void InstallPowObject ( Int verb ) { UInt t1; /* type of left operand */ UInt t2; /* type of right operand */ @@ -1366,8 +1360,6 @@ void InstallPowObject ( Int verb ) ** *F FuncPOW_DEFAULT( , , ) . . . . . . . . call 'PowDefault' */ -Obj PowDefaultFunc; - Obj FuncPOW_DEFAULT ( Obj self, Obj opL, @@ -1417,7 +1409,7 @@ Obj CommDefault ( ** *F CommObject( , ) . . . . . . . . . . . . . . . . call methsel */ -Obj CommOper; +static Obj CommOper; Obj CommObject ( Obj opL, @@ -1453,7 +1445,7 @@ Obj VerboseCommObject ( ** *F InstallCommObject( ) . . . . . . . . . install commutator methods */ -void InstallCommObject ( Int verb ) +static void InstallCommObject ( Int verb ) { UInt t1; /* type of left operand */ UInt t2; /* type of right operand */ @@ -1473,8 +1465,6 @@ void InstallCommObject ( Int verb ) ** *F FuncCOMM_DEFAULT( , , ) . . . . . . call 'CommDefault' */ -Obj CommDefaultFunc; - Obj FuncCOMM_DEFAULT ( Obj self, Obj opL, @@ -1509,7 +1499,7 @@ ArithMethod2 ModFuncs [LAST_REAL_TNUM+1][LAST_REAL_TNUM+1]; ** *F ModObject( , ) . . . . . . . . . . . . . . . . . call methsel */ -Obj ModOper; +static Obj ModOper; Obj ModObject ( Obj opL, @@ -1545,7 +1535,7 @@ Obj VerboseModObject ( ** *F InstallModObject( ) . . . . . . . . . . . install the mod methods */ -void InstallModObject ( Int verb ) +static void InstallModObject ( Int verb ) { UInt t1; /* type of left operand */ UInt t2; /* type of right operand */ @@ -1574,6 +1564,37 @@ Obj FuncMOD ( } +/**************************************************************************** +** +*F ChangeArithDoOperations( , ) +*/ +void ChangeArithDoOperations(Obj oper, Int verb) +{ + /* catch infix operations */ + if ( oper == EqOper ) { InstallEqObject(verb); } + if ( oper == LtOper ) { InstallLtObject(verb); } + if ( oper == InOper ) { InstallInObject(verb); } + if ( oper == SumOper ) { InstallSumObject(verb); } + if ( oper == DiffOper ) { InstallDiffObject(verb); } + if ( oper == ProdOper ) { InstallProdObject(verb); } + if ( oper == QuoOper ) { InstallQuoObject(verb); } + if ( oper == LQuoOper ) { InstallLQuoObject(verb); } + if ( oper == PowOper ) { InstallPowObject(verb); } + if ( oper == CommOper ) { InstallCommObject(verb); } + if ( oper == ModOper ) { InstallModObject(verb); } + + if ( oper == InvOp ) { InstallInvObject(verb); } + if ( oper == OneOp ) { InstallOneObject(verb); } + if ( oper == AInvOp ) { InstallAinvObject(verb); } + if ( oper == ZEROOp ) { InstallZeroObject(verb); } + + if ( oper == InvMutOp ) { InstallInvMutObject(verb); } + if ( oper == OneMutOp ) { InstallOneMutObject(verb); } + if ( oper == AdditiveInverseOp ) { InstallAinvMutObject(verb); } + if ( oper == ZeroOp ) { InstallZeroMutObject(verb); } +} + + /**************************************************************************** ** *F * * * * * * * * * * * * * initialize module * * * * * * * * * * * * * * * diff --git a/src/ariths.h b/src/ariths.h index c63320401a..8f403bd8a8 100644 --- a/src/ariths.h +++ b/src/ariths.h @@ -61,8 +61,6 @@ typedef Obj (* ArithMethod2) ( Obj opL, Obj opR ); */ #define ZERO(op) ((*ZeroFuncs[TNUM_OBJ(op)])(op)) -extern Obj ZEROOp; - /**************************************************************************** ** @@ -71,12 +69,6 @@ extern Obj ZEROOp; extern ArithMethod1 ZeroFuncs [LAST_REAL_TNUM+1]; -/**************************************************************************** -** -*F InstallZeroObject( ) -*/ -extern void InstallZeroObject ( Int ); - /**************************************************************************** ** *F ZERO_MUT( ) . . . . . . . . . . . . . . . . . . . . . zero of an object @@ -85,8 +77,6 @@ extern void InstallZeroObject ( Int ); */ #define ZERO_MUT(op) ((*ZeroMutFuncs[TNUM_OBJ(op)])(op)) -extern Obj ZeroOp; - /**************************************************************************** ** @@ -95,13 +85,6 @@ extern Obj ZeroOp; extern ArithMethod1 ZeroMutFuncs [LAST_REAL_TNUM+1]; -/**************************************************************************** -** -*F InstallZeroMutObject( ) -*/ -extern void InstallZeroMutObject ( Int ); - - /**************************************************************************** ** *F AINV( ) . . . . . . . . . . . . . . . additive inverse of an object @@ -110,8 +93,6 @@ extern void InstallZeroMutObject ( Int ); */ #define AINV(op) ((*AInvFuncs[TNUM_OBJ(op)])(op)) -extern Obj AInvOp; - /**************************************************************************** ** @@ -120,12 +101,6 @@ extern Obj AInvOp; extern ArithMethod1 AInvFuncs [LAST_REAL_TNUM+1]; -/**************************************************************************** -** -*F InstallAinvObject( ) -*/ -extern void InstallAinvObject ( Int ); - /**************************************************************************** ** *F AINV_MUT( ) . . . . . . . . . . . . . additive inverse of an object @@ -134,8 +109,6 @@ extern void InstallAinvObject ( Int ); */ #define AINV_MUT(op) ((*AInvMutFuncs[TNUM_OBJ(op)])(op)) -extern Obj AdditiveInverseOp; - /**************************************************************************** ** @@ -144,13 +117,6 @@ extern Obj AdditiveInverseOp; extern ArithMethod1 AInvMutFuncs [LAST_REAL_TNUM+1]; -/**************************************************************************** -** -*F InstallAinvMutObject( ) -*/ -extern void InstallAinvMutObject ( Int ); - - /**************************************************************************** ** *F C_AINV( , ) . . . . . . . . . . . . . . . . . . compute ainv @@ -183,8 +149,6 @@ extern void InstallAinvMutObject ( Int ); */ #define ONE(op) ((*OneFuncs[TNUM_OBJ(op)])(op)) -extern Obj OneOp; - /**************************************************************************** ** @@ -193,12 +157,6 @@ extern Obj OneOp; extern ArithMethod1 OneFuncs [LAST_REAL_TNUM+1]; -/**************************************************************************** -** -*F InstallOneObject( ) -*/ -extern void InstallOneObject ( Int ); - /**************************************************************************** ** *F ONE_MUT( ) . . . . . . . . one of an object retaining mutability @@ -208,8 +166,6 @@ extern void InstallOneObject ( Int ); */ #define ONE_MUT(op) ((*OneMutFuncs[TNUM_OBJ(op)])(op)) -extern Obj OneMutOp; - /**************************************************************************** ** @@ -218,13 +174,6 @@ extern Obj OneMutOp; extern ArithMethod1 OneMutFuncs [LAST_REAL_TNUM+1]; -/**************************************************************************** -** -*F InstallOneMutObject( ) -*/ -extern void InstallOneMutObject ( Int ); - - /**************************************************************************** ** *F INV( ) . . . . . . . . . . . . . . . . . . . . inverse of an object @@ -233,8 +182,6 @@ extern void InstallOneMutObject ( Int ); */ #define INV(op) ((*InvFuncs[TNUM_OBJ(op)])(op)) -extern Obj InvOp; - /**************************************************************************** ** @@ -243,13 +190,6 @@ extern Obj InvOp; extern ArithMethod1 InvFuncs [LAST_REAL_TNUM+1]; -/**************************************************************************** -** -*F InstallInvObject( ) -*/ -extern void InstallInvObject ( Int ); - - /**************************************************************************** ** *F INV_MUT( ) . . . . . . . . inverse of an object retaining mutability @@ -258,8 +198,6 @@ extern void InstallInvObject ( Int ); */ #define INV_MUT(op) ((*InvMutFuncs[TNUM_OBJ(op)])(op)) -extern Obj InvMutOp; - /**************************************************************************** ** @@ -268,13 +206,6 @@ extern Obj InvMutOp; extern ArithMethod1 InvMutFuncs [LAST_REAL_TNUM+1]; -/**************************************************************************** -** -*F InstallInvMutObject( ) -*/ -extern void InstallInvMutObject ( Int ); - - /**************************************************************************** ** *F * * * * * * * * * * * * * comparison operations * * * * * * * * * * * * * @@ -301,13 +232,6 @@ extern Obj EqOper; extern CompaMethod EqFuncs [LAST_REAL_TNUM+1][LAST_REAL_TNUM+1]; -/**************************************************************************** -** -*F InstallEqObject( ) -*/ -extern void InstallEqObject ( Int ); - - /**************************************************************************** ** *F LT( , ) . . . . . . . . . . . . . . comparison of two objects @@ -329,13 +253,6 @@ extern Obj LtOper; extern CompaMethod LtFuncs [LAST_REAL_TNUM+1][LAST_REAL_TNUM+1]; -/**************************************************************************** -** -*F InstallLtObject( ) -*/ -extern void InstallLtObject ( Int ); - - /**************************************************************************** ** *F IN( , ) . . . . . . . . . . . membership test of two objects @@ -345,8 +262,6 @@ extern void InstallLtObject ( Int ); */ #define IN(opL,opR) ((*InFuncs[TNUM_OBJ(opL)][TNUM_OBJ(opR)])(opL,opR)) -extern Obj InOper; - /**************************************************************************** ** @@ -355,13 +270,6 @@ extern Obj InOper; extern CompaMethod InFuncs [LAST_REAL_TNUM+1][LAST_REAL_TNUM+1]; -/**************************************************************************** -** -*F InstallInObject( ) -*/ -extern void InstallInObject ( Int ); - - /**************************************************************************** ** *F * * * * * * * * * * * binary arithmetic operations * * * * * * * * * * * * @@ -391,13 +299,6 @@ extern Obj SumOper; extern ArithMethod2 SumFuncs [LAST_REAL_TNUM+1][LAST_REAL_TNUM+1]; -/**************************************************************************** -** -*F InstallSumObject( ) -*/ -extern void InstallSumObject ( Int ); - - /**************************************************************************** ** *F C_SUM( , , ) . . . . . . . . . . . . . . . compute sum @@ -440,8 +341,6 @@ extern void InstallSumObject ( Int ); */ #define DIFF(opL,opR) ((*DiffFuncs[TNUM_OBJ(opL)][TNUM_OBJ(opR)])(opL,opR)) -extern Obj DiffOper; - /**************************************************************************** ** @@ -450,13 +349,6 @@ extern Obj DiffOper; extern ArithMethod2 DiffFuncs [LAST_REAL_TNUM+1][LAST_REAL_TNUM+1]; -/**************************************************************************** -** -*F InstallDiffObject( ) -*/ -extern void InstallDiffObject ( Int ); - - /**************************************************************************** ** *F C_DIFF( , , ) . . . . . . . . . . . . . compute diff @@ -499,8 +391,6 @@ extern void InstallDiffObject ( Int ); */ #define PROD(opL,opR) ((*ProdFuncs[TNUM_OBJ(opL)][TNUM_OBJ(opR)])(opL,opR)) -extern Obj ProdOper; - /**************************************************************************** ** @@ -509,13 +399,6 @@ extern Obj ProdOper; extern ArithMethod2 ProdFuncs [LAST_REAL_TNUM+1][LAST_REAL_TNUM+1]; -/**************************************************************************** -** -*F InstallProdObject( ) -*/ -extern void InstallProdObject ( Int ); - - /**************************************************************************** ** *F C_PROD( , , ) . . . . . . . . . . . . compute product @@ -552,8 +435,6 @@ extern void InstallProdObject ( Int ); */ #define QUO(opL,opR) ((*QuoFuncs[TNUM_OBJ(opL)][TNUM_OBJ(opR)])(opL,opR)) -extern Obj QuoOper; - /**************************************************************************** ** @@ -562,13 +443,6 @@ extern Obj QuoOper; extern ArithMethod2 QuoFuncs [LAST_REAL_TNUM+1][LAST_REAL_TNUM+1]; -/**************************************************************************** -** -*F InstallQuoObject( ) -*/ -extern void InstallQuoObject ( Int ); - - /**************************************************************************** ** *F LQUO( , ) . . . . . . . . . . . left quotient of two operand @@ -577,8 +451,6 @@ extern void InstallQuoObject ( Int ); */ #define LQUO(opL,opR) ((*LQuoFuncs[TNUM_OBJ(opL)][TNUM_OBJ(opR)])(opL,opR)) -extern Obj LQuoOper; - /**************************************************************************** ** @@ -587,13 +459,6 @@ extern Obj LQuoOper; extern ArithMethod2 LQuoFuncs [LAST_REAL_TNUM+1][LAST_REAL_TNUM+1]; -/**************************************************************************** -** -*F InstallLQuoObject( ) -*/ -extern void InstallLQuoObject ( Int ); - - /**************************************************************************** ** *F POW( , ) . . . . . . . . . . . . . . . . power of two objects @@ -602,10 +467,6 @@ extern void InstallLQuoObject ( Int ); */ #define POW(opL,opR) ((*PowFuncs[TNUM_OBJ(opL)][TNUM_OBJ(opR)])(opL,opR)) -extern Obj PowOper; - -extern Obj PowDefault ( Obj opL, Obj opR ); - /**************************************************************************** ** @@ -614,13 +475,6 @@ extern Obj PowDefault ( Obj opL, Obj opR ); extern ArithMethod2 PowFuncs [LAST_REAL_TNUM+1][LAST_REAL_TNUM+1]; -/**************************************************************************** -** -*F InstallPowObject( ) -*/ -extern void InstallPowObject ( Int ); - - /**************************************************************************** ** *F COMM( , ) . . . . . . . . . . . . . commutator of two objects @@ -629,8 +483,6 @@ extern void InstallPowObject ( Int ); */ #define COMM(opL,opR) ((*CommFuncs[TNUM_OBJ(opL)][TNUM_OBJ(opR)])(opL,opR)) -extern Obj CommOper; - /**************************************************************************** ** @@ -639,13 +491,6 @@ extern Obj CommOper; extern ArithMethod2 CommFuncs [LAST_REAL_TNUM+1][LAST_REAL_TNUM+1]; -/**************************************************************************** -** -*F InstallCommObject( ) -*/ -extern void InstallCommObject ( Int ); - - /**************************************************************************** ** *F MOD( , ) . . . . . . . . . . . . . . remainder of two objects @@ -654,8 +499,6 @@ extern void InstallCommObject ( Int ); */ #define MOD(opL,opR) ((*ModFuncs[TNUM_OBJ(opL)][TNUM_OBJ(opR)])(opL,opR)) -extern Obj ModOper; - /**************************************************************************** ** @@ -666,9 +509,9 @@ extern ArithMethod2 ModFuncs [LAST_REAL_TNUM+1][LAST_REAL_TNUM+1]; /**************************************************************************** ** -*F InstallModObject( ) +*F ChangeArithDoOperations( , ) */ -extern void InstallModObject ( Int ); +extern void ChangeArithDoOperations(Obj oper, Int verb); /**************************************************************************** diff --git a/src/opers.c b/src/opers.c index c1998730af..eccfca0b6f 100644 --- a/src/opers.c +++ b/src/opers.c @@ -3828,28 +3828,7 @@ void ChangeDoOperations ( Int i; Int j; - /* catch infix operations */ - if ( oper == EqOper ) { InstallEqObject(verb); } - if ( oper == LtOper ) { InstallLtObject(verb); } - if ( oper == InOper ) { InstallInObject(verb); } - if ( oper == SumOper ) { InstallSumObject(verb); } - if ( oper == DiffOper ) { InstallDiffObject(verb); } - if ( oper == ProdOper ) { InstallProdObject(verb); } - if ( oper == QuoOper ) { InstallQuoObject(verb); } - if ( oper == LQuoOper ) { InstallLQuoObject(verb); } - if ( oper == PowOper ) { InstallPowObject(verb); } - if ( oper == CommOper ) { InstallCommObject(verb); } - if ( oper == ModOper ) { InstallModObject(verb); } - - if ( oper == InvOp ) { InstallInvObject(verb); } - if ( oper == OneOp ) { InstallOneObject(verb); } - if ( oper == AInvOp ) { InstallAinvObject(verb); } - if ( oper == ZEROOp ) { InstallZeroObject(verb); } - - if ( oper == InvMutOp ) { InstallInvMutObject(verb); } - if ( oper == OneMutOp ) { InstallOneMutObject(verb); } - if ( oper == AdditiveInverseOp ) { InstallAinvMutObject(verb); } - if ( oper == ZeroOp ) { InstallZeroMutObject(verb); } + ChangeArithDoOperations(oper, verb); /* be verbose */ if ( verb ) {