CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Path: gap4r8 / src / c_oper1.c
Views: 418346
1
#ifndef AVOID_PRECOMPILED
2
/* C file produced by GAC */
3
#include "src/compiled.h"
4
5
/* global variables used in handlers */
6
static GVar G_REREADING;
7
static Obj GC_REREADING;
8
static GVar G_SHALLOW__COPY__OBJ;
9
static Obj GF_SHALLOW__COPY__OBJ;
10
static GVar G_PRINT__OBJ;
11
static Obj GC_PRINT__OBJ;
12
static GVar G_GAPInfo;
13
static Obj GC_GAPInfo;
14
static GVar G_IS__FUNCTION;
15
static Obj GF_IS__FUNCTION;
16
static GVar G_NAME__FUNC;
17
static Obj GF_NAME__FUNC;
18
static GVar G_NARG__FUNC;
19
static Obj GF_NARG__FUNC;
20
static GVar G_IS__OPERATION;
21
static Obj GF_IS__OPERATION;
22
static GVar G_AINV;
23
static Obj GF_AINV;
24
static GVar G_IS__INT;
25
static Obj GF_IS__INT;
26
static GVar G_IS__LIST;
27
static Obj GF_IS__LIST;
28
static GVar G_ADD__LIST;
29
static Obj GF_ADD__LIST;
30
static GVar G_IS__STRING__REP;
31
static Obj GF_IS__STRING__REP;
32
static GVar G_Error;
33
static Obj GF_Error;
34
static GVar G_TYPE__OBJ;
35
static Obj GF_TYPE__OBJ;
36
static GVar G_IMMUTABLE__COPY__OBJ;
37
static Obj GF_IMMUTABLE__COPY__OBJ;
38
static GVar G_IS__IDENTICAL__OBJ;
39
static Obj GF_IS__IDENTICAL__OBJ;
40
static GVar G_IS__OBJECT;
41
static Obj GC_IS__OBJECT;
42
static GVar G_TRY__NEXT__METHOD;
43
static Obj GC_TRY__NEXT__METHOD;
44
static GVar G_SUB__FLAGS;
45
static Obj GF_SUB__FLAGS;
46
static GVar G_WITH__HIDDEN__IMPS__FLAGS;
47
static Obj GF_WITH__HIDDEN__IMPS__FLAGS;
48
static GVar G_IS__SUBSET__FLAGS;
49
static Obj GF_IS__SUBSET__FLAGS;
50
static GVar G_TRUES__FLAGS;
51
static Obj GF_TRUES__FLAGS;
52
static GVar G_SIZE__FLAGS;
53
static Obj GF_SIZE__FLAGS;
54
static GVar G_LEN__FLAGS;
55
static Obj GF_LEN__FLAGS;
56
static GVar G_ELM__FLAGS;
57
static Obj GF_ELM__FLAGS;
58
static GVar G_FLAG1__FILTER;
59
static Obj GF_FLAG1__FILTER;
60
static GVar G_FLAGS__FILTER;
61
static Obj GF_FLAGS__FILTER;
62
static GVar G_METHODS__OPERATION;
63
static Obj GF_METHODS__OPERATION;
64
static GVar G_CHANGED__METHODS__OPERATION;
65
static Obj GF_CHANGED__METHODS__OPERATION;
66
static GVar G_DO__NOTHING__SETTER;
67
static Obj GC_DO__NOTHING__SETTER;
68
static GVar G_RETURN__TRUE;
69
static Obj GC_RETURN__TRUE;
70
static GVar G_RETURN__FALSE;
71
static Obj GC_RETURN__FALSE;
72
static GVar G_LEN__LIST;
73
static Obj GF_LEN__LIST;
74
static GVar G_APPEND__LIST__INTR;
75
static Obj GF_APPEND__LIST__INTR;
76
static GVar G_CONV__STRING;
77
static Obj GF_CONV__STRING;
78
static GVar G_Print;
79
static Obj GF_Print;
80
static GVar G_ViewObj;
81
static Obj GC_ViewObj;
82
static GVar G_RUN__IMMEDIATE__METHODS__CHECKS;
83
static Obj GC_RUN__IMMEDIATE__METHODS__CHECKS;
84
static GVar G_RUN__IMMEDIATE__METHODS__HITS;
85
static Obj GC_RUN__IMMEDIATE__METHODS__HITS;
86
static GVar G_BIND__GLOBAL;
87
static Obj GF_BIND__GLOBAL;
88
static GVar G_IGNORE__IMMEDIATE__METHODS;
89
static Obj GC_IGNORE__IMMEDIATE__METHODS;
90
static GVar G_IMM__FLAGS;
91
static Obj GC_IMM__FLAGS;
92
static GVar G_IMMEDIATES;
93
static Obj GC_IMMEDIATES;
94
static GVar G_IMMEDIATE__METHODS;
95
static Obj GC_IMMEDIATE__METHODS;
96
static GVar G_TRACE__IMMEDIATE__METHODS;
97
static Obj GC_TRACE__IMMEDIATE__METHODS;
98
static GVar G_CONSTRUCTORS;
99
static Obj GC_CONSTRUCTORS;
100
static GVar G_RankFilter;
101
static Obj GF_RankFilter;
102
static GVar G_CHECK__INSTALL__METHOD;
103
static Obj GC_CHECK__INSTALL__METHOD;
104
static GVar G_INSTALL__METHOD;
105
static Obj GF_INSTALL__METHOD;
106
static GVar G_DeclareGlobalFunction;
107
static Obj GF_DeclareGlobalFunction;
108
static GVar G_EvalString;
109
static Obj GF_EvalString;
110
static GVar G_WRAPPER__OPERATIONS;
111
static Obj GC_WRAPPER__OPERATIONS;
112
static GVar G_INFO__DEBUG;
113
static Obj GF_INFO__DEBUG;
114
static GVar G_OPERATIONS;
115
static Obj GC_OPERATIONS;
116
static GVar G_NamesFilter;
117
static Obj GF_NamesFilter;
118
static GVar G_Ordinal;
119
static Obj GF_Ordinal;
120
static GVar G_INSTALL__METHOD__FLAGS;
121
static Obj GF_INSTALL__METHOD__FLAGS;
122
static GVar G_LENGTH__SETTER__METHODS__2;
123
static Obj GC_LENGTH__SETTER__METHODS__2;
124
static GVar G_InstallAttributeFunction;
125
static Obj GF_InstallAttributeFunction;
126
static GVar G_CATS__AND__REPS;
127
static Obj GC_CATS__AND__REPS;
128
static GVar G_FILTERS;
129
static Obj GC_FILTERS;
130
static GVar G_NUMBERS__PROPERTY__GETTERS;
131
static Obj GC_NUMBERS__PROPERTY__GETTERS;
132
static GVar G_InstallOtherMethod;
133
static Obj GF_InstallOtherMethod;
134
static GVar G_Tester;
135
static Obj GF_Tester;
136
static GVar G_IsPrimeInt;
137
static Obj GF_IsPrimeInt;
138
static GVar G_DeclareOperation;
139
static Obj GF_DeclareOperation;
140
static GVar G_VALUE__GLOBAL;
141
static Obj GF_VALUE__GLOBAL;
142
static GVar G_DeclareAttribute;
143
static Obj GF_DeclareAttribute;
144
static GVar G_InstallMethod;
145
static Obj GF_InstallMethod;
146
static GVar G_CallFuncList;
147
static Obj GF_CallFuncList;
148
149
/* record names used in handlers */
150
static RNam R_MaxNrArgsMethod;
151
152
/* information for the functions */
153
static Obj NameFunc[16];
154
static Obj NamsFunc[16];
155
static Int NargFunc[16];
156
static Obj DefaultName;
157
static Obj FileName;
158
159
/* handler for function 2 */
160
static Obj HdlrFunc2 (
161
Obj self,
162
Obj a_obj,
163
Obj a_flags )
164
{
165
Obj l_flagspos = 0;
166
Obj l_tried = 0;
167
Obj l_type = 0;
168
Obj l_j = 0;
169
Obj l_imm = 0;
170
Obj l_i = 0;
171
Obj l_res = 0;
172
Obj l_newflags = 0;
173
Obj t_1 = 0;
174
Obj t_2 = 0;
175
Obj t_3 = 0;
176
Obj t_4 = 0;
177
Obj t_5 = 0;
178
Obj t_6 = 0;
179
Obj t_7 = 0;
180
Obj t_8 = 0;
181
Obj t_9 = 0;
182
Obj t_10 = 0;
183
Obj t_11 = 0;
184
Obj t_12 = 0;
185
Obj t_13 = 0;
186
Obj t_14 = 0;
187
Obj t_15 = 0;
188
Obj t_16 = 0;
189
Obj t_17 = 0;
190
Bag oldFrame;
191
OLD_BRK_CURR_STAT
192
193
/* allocate new stack frame */
194
SWITCH_TO_NEW_FRAME(self,0,0,oldFrame);
195
REM_BRK_CURR_STAT();
196
SET_BRK_CURR_STAT(0);
197
198
/* if IGNORE_IMMEDIATE_METHODS then */
199
t_2 = GC_IGNORE__IMMEDIATE__METHODS;
200
CHECK_BOUND( t_2, "IGNORE_IMMEDIATE_METHODS" )
201
CHECK_BOOL( t_2 )
202
t_1 = (Obj)(UInt)(t_2 != False);
203
if ( t_1 ) {
204
205
/* return; */
206
RES_BRK_CURR_STAT();
207
SWITCH_TO_OLD_FRAME(oldFrame);
208
return 0;
209
210
}
211
/* fi */
212
213
/* if IS_SUBSET_FLAGS( IMM_FLAGS, flags ) then */
214
t_3 = GF_IS__SUBSET__FLAGS;
215
t_4 = GC_IMM__FLAGS;
216
CHECK_BOUND( t_4, "IMM_FLAGS" )
217
t_2 = CALL_2ARGS( t_3, t_4, a_flags );
218
CHECK_FUNC_RESULT( t_2 )
219
CHECK_BOOL( t_2 )
220
t_1 = (Obj)(UInt)(t_2 != False);
221
if ( t_1 ) {
222
223
/* return; */
224
RES_BRK_CURR_STAT();
225
SWITCH_TO_OLD_FRAME(oldFrame);
226
return 0;
227
228
}
229
/* fi */
230
231
/* flags := SUB_FLAGS( flags, IMM_FLAGS ); */
232
t_2 = GF_SUB__FLAGS;
233
t_3 = GC_IMM__FLAGS;
234
CHECK_BOUND( t_3, "IMM_FLAGS" )
235
t_1 = CALL_2ARGS( t_2, a_flags, t_3 );
236
CHECK_FUNC_RESULT( t_1 )
237
a_flags = t_1;
238
239
/* flagspos := SHALLOW_COPY_OBJ( TRUES_FLAGS( flags ) ); */
240
t_2 = GF_SHALLOW__COPY__OBJ;
241
t_4 = GF_TRUES__FLAGS;
242
t_3 = CALL_1ARGS( t_4, a_flags );
243
CHECK_FUNC_RESULT( t_3 )
244
t_1 = CALL_1ARGS( t_2, t_3 );
245
CHECK_FUNC_RESULT( t_1 )
246
l_flagspos = t_1;
247
248
/* tried := [ ]; */
249
t_1 = NEW_PLIST( T_PLIST, 0 );
250
SET_LEN_PLIST( t_1, 0 );
251
l_tried = t_1;
252
253
/* type := TYPE_OBJ( obj ); */
254
t_2 = GF_TYPE__OBJ;
255
t_1 = CALL_1ARGS( t_2, a_obj );
256
CHECK_FUNC_RESULT( t_1 )
257
l_type = t_1;
258
259
/* flags := type![2]; */
260
C_ELM_POSOBJ_NLE( t_1, l_type, 2 );
261
a_flags = t_1;
262
263
/* for j in flagspos do */
264
t_4 = l_flagspos;
265
if ( IS_SMALL_LIST(t_4) ) {
266
t_3 = (Obj)(UInt)1;
267
t_1 = INTOBJ_INT(1);
268
}
269
else {
270
t_3 = (Obj)(UInt)0;
271
t_1 = CALL_1ARGS( GF_ITERATOR, t_4 );
272
}
273
while ( 1 ) {
274
if ( t_3 ) {
275
if ( LEN_LIST(t_4) < INT_INTOBJ(t_1) ) break;
276
t_2 = ELMV0_LIST( t_4, INT_INTOBJ(t_1) );
277
t_1 = (Obj)(((UInt)t_1)+4);
278
if ( t_2 == 0 ) continue;
279
}
280
else {
281
if ( CALL_1ARGS( GF_IS_DONE_ITER, t_1 ) != False ) break;
282
t_2 = CALL_1ARGS( GF_NEXT_ITER, t_1 );
283
}
284
l_j = t_2;
285
286
/* if IsBound( IMMEDIATES[j] ) then */
287
t_7 = GC_IMMEDIATES;
288
CHECK_BOUND( t_7, "IMMEDIATES" )
289
CHECK_INT_POS( l_j )
290
t_6 = C_ISB_LIST( t_7, l_j );
291
t_5 = (Obj)(UInt)(t_6 != False);
292
if ( t_5 ) {
293
294
/* imm := IMMEDIATES[j]; */
295
t_6 = GC_IMMEDIATES;
296
CHECK_BOUND( t_6, "IMMEDIATES" )
297
C_ELM_LIST_FPL( t_5, t_6, l_j )
298
l_imm = t_5;
299
300
/* for i in [ 0, 7 .. LEN_LIST( imm ) - 7 ] do */
301
t_11 = GF_LEN__LIST;
302
t_10 = CALL_1ARGS( t_11, l_imm );
303
CHECK_FUNC_RESULT( t_10 )
304
C_DIFF_FIA( t_9, t_10, INTOBJ_INT(7) )
305
t_8 = Range3Check( INTOBJ_INT(0), INTOBJ_INT(7), t_9 );
306
if ( IS_SMALL_LIST(t_8) ) {
307
t_7 = (Obj)(UInt)1;
308
t_5 = INTOBJ_INT(1);
309
}
310
else {
311
t_7 = (Obj)(UInt)0;
312
t_5 = CALL_1ARGS( GF_ITERATOR, t_8 );
313
}
314
while ( 1 ) {
315
if ( t_7 ) {
316
if ( LEN_LIST(t_8) < INT_INTOBJ(t_5) ) break;
317
t_6 = ELMV0_LIST( t_8, INT_INTOBJ(t_5) );
318
t_5 = (Obj)(((UInt)t_5)+4);
319
if ( t_6 == 0 ) continue;
320
}
321
else {
322
if ( CALL_1ARGS( GF_IS_DONE_ITER, t_5 ) != False ) break;
323
t_6 = CALL_1ARGS( GF_NEXT_ITER, t_5 );
324
}
325
l_i = t_6;
326
327
/* if IS_SUBSET_FLAGS( flags, imm[i + 4] ) and not IS_SUBSET_FLAGS( flags, imm[i + 3] ) and not imm[i + 6] in tried then */
328
t_13 = GF_IS__SUBSET__FLAGS;
329
C_SUM_FIA( t_15, l_i, INTOBJ_INT(4) )
330
CHECK_INT_POS( t_15 )
331
C_ELM_LIST_FPL( t_14, l_imm, t_15 )
332
t_12 = CALL_2ARGS( t_13, a_flags, t_14 );
333
CHECK_FUNC_RESULT( t_12 )
334
CHECK_BOOL( t_12 )
335
t_11 = (Obj)(UInt)(t_12 != False);
336
t_10 = t_11;
337
if ( t_10 ) {
338
t_15 = GF_IS__SUBSET__FLAGS;
339
C_SUM_FIA( t_17, l_i, INTOBJ_INT(3) )
340
CHECK_INT_POS( t_17 )
341
C_ELM_LIST_FPL( t_16, l_imm, t_17 )
342
t_14 = CALL_2ARGS( t_15, a_flags, t_16 );
343
CHECK_FUNC_RESULT( t_14 )
344
CHECK_BOOL( t_14 )
345
t_13 = (Obj)(UInt)(t_14 != False);
346
t_12 = (Obj)(UInt)( ! ((Int)t_13) );
347
t_10 = t_12;
348
}
349
t_9 = t_10;
350
if ( t_9 ) {
351
C_SUM_FIA( t_14, l_i, INTOBJ_INT(6) )
352
CHECK_INT_POS( t_14 )
353
C_ELM_LIST_FPL( t_13, l_imm, t_14 )
354
t_12 = (Obj)(UInt)(IN( t_13, l_tried ));
355
t_11 = (Obj)(UInt)( ! ((Int)t_12) );
356
t_9 = t_11;
357
}
358
if ( t_9 ) {
359
360
/* res := IMMEDIATE_METHODS[imm[i + 6]]( obj ); */
361
t_11 = GC_IMMEDIATE__METHODS;
362
CHECK_BOUND( t_11, "IMMEDIATE_METHODS" )
363
C_SUM_FIA( t_13, l_i, INTOBJ_INT(6) )
364
CHECK_INT_POS( t_13 )
365
C_ELM_LIST_FPL( t_12, l_imm, t_13 )
366
CHECK_INT_POS( t_12 )
367
C_ELM_LIST_FPL( t_10, t_11, t_12 )
368
CHECK_FUNC( t_10 )
369
t_9 = CALL_1ARGS( t_10, a_obj );
370
CHECK_FUNC_RESULT( t_9 )
371
l_res = t_9;
372
373
/* ADD_LIST( tried, imm[i + 6] ); */
374
t_9 = GF_ADD__LIST;
375
C_SUM_FIA( t_11, l_i, INTOBJ_INT(6) )
376
CHECK_INT_POS( t_11 )
377
C_ELM_LIST_FPL( t_10, l_imm, t_11 )
378
CALL_2ARGS( t_9, l_tried, t_10 );
379
380
/* RUN_IMMEDIATE_METHODS_CHECKS := RUN_IMMEDIATE_METHODS_CHECKS + 1; */
381
t_10 = GC_RUN__IMMEDIATE__METHODS__CHECKS;
382
CHECK_BOUND( t_10, "RUN_IMMEDIATE_METHODS_CHECKS" )
383
C_SUM_FIA( t_9, t_10, INTOBJ_INT(1) )
384
AssGVar( G_RUN__IMMEDIATE__METHODS__CHECKS, t_9 );
385
386
/* if TRACE_IMMEDIATE_METHODS then */
387
t_10 = GC_TRACE__IMMEDIATE__METHODS;
388
CHECK_BOUND( t_10, "TRACE_IMMEDIATE_METHODS" )
389
CHECK_BOOL( t_10 )
390
t_9 = (Obj)(UInt)(t_10 != False);
391
if ( t_9 ) {
392
393
/* if imm[i + 7] = false then */
394
C_SUM_FIA( t_11, l_i, INTOBJ_INT(7) )
395
CHECK_INT_POS( t_11 )
396
C_ELM_LIST_FPL( t_10, l_imm, t_11 )
397
t_11 = False;
398
t_9 = (Obj)(UInt)(EQ( t_10, t_11 ));
399
if ( t_9 ) {
400
401
/* Print( "#I immediate: ", NAME_FUNC( imm[i + 1] ), "\n" ); */
402
t_9 = GF_Print;
403
C_NEW_STRING( t_10, 15, "#I immediate: " );
404
t_12 = GF_NAME__FUNC;
405
C_SUM_FIA( t_14, l_i, INTOBJ_INT(1) )
406
CHECK_INT_POS( t_14 )
407
C_ELM_LIST_FPL( t_13, l_imm, t_14 )
408
t_11 = CALL_1ARGS( t_12, t_13 );
409
CHECK_FUNC_RESULT( t_11 )
410
C_NEW_STRING( t_12, 1, "\n" );
411
CALL_3ARGS( t_9, t_10, t_11, t_12 );
412
413
}
414
415
/* else */
416
else {
417
418
/* Print( "#I immediate: ", NAME_FUNC( imm[i + 1] ), ": ", imm[i + 7], "\n" ); */
419
t_9 = GF_Print;
420
C_NEW_STRING( t_10, 15, "#I immediate: " );
421
t_12 = GF_NAME__FUNC;
422
C_SUM_FIA( t_14, l_i, INTOBJ_INT(1) )
423
CHECK_INT_POS( t_14 )
424
C_ELM_LIST_FPL( t_13, l_imm, t_14 )
425
t_11 = CALL_1ARGS( t_12, t_13 );
426
CHECK_FUNC_RESULT( t_11 )
427
C_NEW_STRING( t_12, 2, ": " );
428
C_SUM_FIA( t_14, l_i, INTOBJ_INT(7) )
429
CHECK_INT_POS( t_14 )
430
C_ELM_LIST_FPL( t_13, l_imm, t_14 )
431
C_NEW_STRING( t_14, 1, "\n" );
432
CALL_5ARGS( t_9, t_10, t_11, t_12, t_13, t_14 );
433
434
}
435
/* fi */
436
437
}
438
/* fi */
439
440
/* if res <> TRY_NEXT_METHOD then */
441
t_10 = GC_TRY__NEXT__METHOD;
442
CHECK_BOUND( t_10, "TRY_NEXT_METHOD" )
443
t_9 = (Obj)(UInt)( ! EQ( l_res, t_10 ));
444
if ( t_9 ) {
445
446
/* IGNORE_IMMEDIATE_METHODS := true; */
447
t_9 = True;
448
AssGVar( G_IGNORE__IMMEDIATE__METHODS, t_9 );
449
450
/* imm[i + 2]( obj, res ); */
451
C_SUM_FIA( t_10, l_i, INTOBJ_INT(2) )
452
CHECK_INT_POS( t_10 )
453
C_ELM_LIST_FPL( t_9, l_imm, t_10 )
454
CHECK_FUNC( t_9 )
455
CALL_2ARGS( t_9, a_obj, l_res );
456
457
/* IGNORE_IMMEDIATE_METHODS := false; */
458
t_9 = False;
459
AssGVar( G_IGNORE__IMMEDIATE__METHODS, t_9 );
460
461
/* RUN_IMMEDIATE_METHODS_HITS := RUN_IMMEDIATE_METHODS_HITS + 1; */
462
t_10 = GC_RUN__IMMEDIATE__METHODS__HITS;
463
CHECK_BOUND( t_10, "RUN_IMMEDIATE_METHODS_HITS" )
464
C_SUM_FIA( t_9, t_10, INTOBJ_INT(1) )
465
AssGVar( G_RUN__IMMEDIATE__METHODS__HITS, t_9 );
466
467
/* if not IS_IDENTICAL_OBJ( TYPE_OBJ( obj ), type ) then */
468
t_12 = GF_IS__IDENTICAL__OBJ;
469
t_14 = GF_TYPE__OBJ;
470
t_13 = CALL_1ARGS( t_14, a_obj );
471
CHECK_FUNC_RESULT( t_13 )
472
t_11 = CALL_2ARGS( t_12, t_13, l_type );
473
CHECK_FUNC_RESULT( t_11 )
474
CHECK_BOOL( t_11 )
475
t_10 = (Obj)(UInt)(t_11 != False);
476
t_9 = (Obj)(UInt)( ! ((Int)t_10) );
477
if ( t_9 ) {
478
479
/* type := TYPE_OBJ( obj ); */
480
t_10 = GF_TYPE__OBJ;
481
t_9 = CALL_1ARGS( t_10, a_obj );
482
CHECK_FUNC_RESULT( t_9 )
483
l_type = t_9;
484
485
/* newflags := SUB_FLAGS( type![2], IMM_FLAGS ); */
486
t_10 = GF_SUB__FLAGS;
487
C_ELM_POSOBJ_NLE( t_11, l_type, 2 );
488
t_12 = GC_IMM__FLAGS;
489
CHECK_BOUND( t_12, "IMM_FLAGS" )
490
t_9 = CALL_2ARGS( t_10, t_11, t_12 );
491
CHECK_FUNC_RESULT( t_9 )
492
l_newflags = t_9;
493
494
/* newflags := SUB_FLAGS( newflags, flags ); */
495
t_10 = GF_SUB__FLAGS;
496
t_9 = CALL_2ARGS( t_10, l_newflags, a_flags );
497
CHECK_FUNC_RESULT( t_9 )
498
l_newflags = t_9;
499
500
/* APPEND_LIST_INTR( flagspos, TRUES_FLAGS( newflags ) ); */
501
t_9 = GF_APPEND__LIST__INTR;
502
t_11 = GF_TRUES__FLAGS;
503
t_10 = CALL_1ARGS( t_11, l_newflags );
504
CHECK_FUNC_RESULT( t_10 )
505
CALL_2ARGS( t_9, l_flagspos, t_10 );
506
507
/* flags := type![2]; */
508
C_ELM_POSOBJ_NLE( t_9, l_type, 2 );
509
a_flags = t_9;
510
511
}
512
/* fi */
513
514
}
515
/* fi */
516
517
}
518
/* fi */
519
520
}
521
/* od */
522
523
}
524
/* fi */
525
526
}
527
/* od */
528
529
/* return; */
530
RES_BRK_CURR_STAT();
531
SWITCH_TO_OLD_FRAME(oldFrame);
532
return 0;
533
534
/* return; */
535
RES_BRK_CURR_STAT();
536
SWITCH_TO_OLD_FRAME(oldFrame);
537
return 0;
538
}
539
540
/* handler for function 3 */
541
static Obj HdlrFunc3 (
542
Obj self,
543
Obj a_opr,
544
Obj a_info,
545
Obj a_rel,
546
Obj a_flags,
547
Obj a_rank,
548
Obj a_method )
549
{
550
Obj l_methods = 0;
551
Obj l_narg = 0;
552
Obj l_i = 0;
553
Obj l_k = 0;
554
Obj l_tmp = 0;
555
Obj l_replace = 0;
556
Obj l_match = 0;
557
Obj l_j = 0;
558
Obj t_1 = 0;
559
Obj t_2 = 0;
560
Obj t_3 = 0;
561
Obj t_4 = 0;
562
Obj t_5 = 0;
563
Obj t_6 = 0;
564
Obj t_7 = 0;
565
Obj t_8 = 0;
566
Bag oldFrame;
567
OLD_BRK_CURR_STAT
568
569
/* allocate new stack frame */
570
SWITCH_TO_NEW_FRAME(self,0,0,oldFrame);
571
REM_BRK_CURR_STAT();
572
SET_BRK_CURR_STAT(0);
573
574
/* if opr in CONSTRUCTORS then */
575
t_2 = GC_CONSTRUCTORS;
576
CHECK_BOUND( t_2, "CONSTRUCTORS" )
577
t_1 = (Obj)(UInt)(IN( a_opr, t_2 ));
578
if ( t_1 ) {
579
580
/* if 0 < LEN_LIST( flags ) then */
581
t_3 = GF_LEN__LIST;
582
t_2 = CALL_1ARGS( t_3, a_flags );
583
CHECK_FUNC_RESULT( t_2 )
584
t_1 = (Obj)(UInt)(LT( INTOBJ_INT(0), t_2 ));
585
if ( t_1 ) {
586
587
/* rank := rank - RankFilter( flags[1] ); */
588
t_3 = GF_RankFilter;
589
C_ELM_LIST_FPL( t_4, a_flags, INTOBJ_INT(1) )
590
t_2 = CALL_1ARGS( t_3, t_4 );
591
CHECK_FUNC_RESULT( t_2 )
592
C_DIFF_FIA( t_1, a_rank, t_2 )
593
a_rank = t_1;
594
595
}
596
/* fi */
597
598
}
599
600
/* else */
601
else {
602
603
/* for i in flags do */
604
t_4 = a_flags;
605
if ( IS_SMALL_LIST(t_4) ) {
606
t_3 = (Obj)(UInt)1;
607
t_1 = INTOBJ_INT(1);
608
}
609
else {
610
t_3 = (Obj)(UInt)0;
611
t_1 = CALL_1ARGS( GF_ITERATOR, t_4 );
612
}
613
while ( 1 ) {
614
if ( t_3 ) {
615
if ( LEN_LIST(t_4) < INT_INTOBJ(t_1) ) break;
616
t_2 = ELMV0_LIST( t_4, INT_INTOBJ(t_1) );
617
t_1 = (Obj)(((UInt)t_1)+4);
618
if ( t_2 == 0 ) continue;
619
}
620
else {
621
if ( CALL_1ARGS( GF_IS_DONE_ITER, t_1 ) != False ) break;
622
t_2 = CALL_1ARGS( GF_NEXT_ITER, t_1 );
623
}
624
l_i = t_2;
625
626
/* rank := rank + RankFilter( i ); */
627
t_7 = GF_RankFilter;
628
t_6 = CALL_1ARGS( t_7, l_i );
629
CHECK_FUNC_RESULT( t_6 )
630
C_SUM_FIA( t_5, a_rank, t_6 )
631
a_rank = t_5;
632
633
}
634
/* od */
635
636
}
637
/* fi */
638
639
/* narg := LEN_LIST( flags ); */
640
t_2 = GF_LEN__LIST;
641
t_1 = CALL_1ARGS( t_2, a_flags );
642
CHECK_FUNC_RESULT( t_1 )
643
l_narg = t_1;
644
645
/* methods := METHODS_OPERATION( opr, narg ); */
646
t_2 = GF_METHODS__OPERATION;
647
t_1 = CALL_2ARGS( t_2, a_opr, l_narg );
648
CHECK_FUNC_RESULT( t_1 )
649
l_methods = t_1;
650
651
/* if info = false then */
652
t_2 = False;
653
t_1 = (Obj)(UInt)(EQ( a_info, t_2 ));
654
if ( t_1 ) {
655
656
/* info := NAME_FUNC( opr ); */
657
t_2 = GF_NAME__FUNC;
658
t_1 = CALL_1ARGS( t_2, a_opr );
659
CHECK_FUNC_RESULT( t_1 )
660
a_info = t_1;
661
662
}
663
664
/* else */
665
else {
666
667
/* k := SHALLOW_COPY_OBJ( NAME_FUNC( opr ) ); */
668
t_2 = GF_SHALLOW__COPY__OBJ;
669
t_4 = GF_NAME__FUNC;
670
t_3 = CALL_1ARGS( t_4, a_opr );
671
CHECK_FUNC_RESULT( t_3 )
672
t_1 = CALL_1ARGS( t_2, t_3 );
673
CHECK_FUNC_RESULT( t_1 )
674
l_k = t_1;
675
676
/* APPEND_LIST_INTR( k, ": " ); */
677
t_1 = GF_APPEND__LIST__INTR;
678
C_NEW_STRING( t_2, 2, ": " );
679
CALL_2ARGS( t_1, l_k, t_2 );
680
681
/* APPEND_LIST_INTR( k, info ); */
682
t_1 = GF_APPEND__LIST__INTR;
683
CALL_2ARGS( t_1, l_k, a_info );
684
685
/* info := k; */
686
a_info = l_k;
687
688
/* CONV_STRING( info ); */
689
t_1 = GF_CONV__STRING;
690
CALL_1ARGS( t_1, a_info );
691
692
}
693
/* fi */
694
695
/* i := 0; */
696
l_i = INTOBJ_INT(0);
697
698
/* while i < LEN_LIST( methods ) and rank < methods[i + (narg + 3)] od */
699
while ( 1 ) {
700
t_4 = GF_LEN__LIST;
701
t_3 = CALL_1ARGS( t_4, l_methods );
702
CHECK_FUNC_RESULT( t_3 )
703
t_2 = (Obj)(UInt)(LT( l_i, t_3 ));
704
t_1 = t_2;
705
if ( t_1 ) {
706
C_SUM_FIA( t_6, l_narg, INTOBJ_INT(3) )
707
C_SUM_FIA( t_5, l_i, t_6 )
708
CHECK_INT_POS( t_5 )
709
C_ELM_LIST_FPL( t_4, l_methods, t_5 )
710
t_3 = (Obj)(UInt)(LT( a_rank, t_4 ));
711
t_1 = t_3;
712
}
713
if ( ! t_1 ) break;
714
715
/* i := i + (narg + 4); */
716
C_SUM_FIA( t_2, l_narg, INTOBJ_INT(4) )
717
C_SUM_FIA( t_1, l_i, t_2 )
718
l_i = t_1;
719
720
}
721
/* od */
722
723
/* replace := false; */
724
t_1 = False;
725
l_replace = t_1;
726
727
/* if REREADING then */
728
t_2 = GC_REREADING;
729
CHECK_BOUND( t_2, "REREADING" )
730
CHECK_BOOL( t_2 )
731
t_1 = (Obj)(UInt)(t_2 != False);
732
if ( t_1 ) {
733
734
/* k := i; */
735
l_k = l_i;
736
737
/* while k < LEN_LIST( methods ) and rank = methods[k + narg + 3] od */
738
while ( 1 ) {
739
t_4 = GF_LEN__LIST;
740
t_3 = CALL_1ARGS( t_4, l_methods );
741
CHECK_FUNC_RESULT( t_3 )
742
t_2 = (Obj)(UInt)(LT( l_k, t_3 ));
743
t_1 = t_2;
744
if ( t_1 ) {
745
C_SUM_FIA( t_6, l_k, l_narg )
746
C_SUM_FIA( t_5, t_6, INTOBJ_INT(3) )
747
CHECK_INT_POS( t_5 )
748
C_ELM_LIST_FPL( t_4, l_methods, t_5 )
749
t_3 = (Obj)(UInt)(EQ( a_rank, t_4 ));
750
t_1 = t_3;
751
}
752
if ( ! t_1 ) break;
753
754
/* if info = methods[k + narg + 4] then */
755
C_SUM_FIA( t_4, l_k, l_narg )
756
C_SUM_FIA( t_3, t_4, INTOBJ_INT(4) )
757
CHECK_INT_POS( t_3 )
758
C_ELM_LIST_FPL( t_2, l_methods, t_3 )
759
t_1 = (Obj)(UInt)(EQ( a_info, t_2 ));
760
if ( t_1 ) {
761
762
/* match := false; */
763
t_1 = False;
764
l_match = t_1;
765
766
/* for j in [ 1 .. narg ] do */
767
CHECK_INT_SMALL( l_narg )
768
t_2 = l_narg;
769
for ( t_1 = INTOBJ_INT(1);
770
((Int)t_1) <= ((Int)t_2);
771
t_1 = (Obj)(((UInt)t_1)+4) ) {
772
l_j = t_1;
773
774
/* match := match and methods[k + j + 1] = flags[j]; */
775
if ( l_match == False ) {
776
t_3 = l_match;
777
}
778
else if ( l_match == True ) {
779
C_SUM_FIA( t_7, l_k, l_j )
780
C_SUM_FIA( t_6, t_7, INTOBJ_INT(1) )
781
CHECK_INT_POS( t_6 )
782
C_ELM_LIST_FPL( t_5, l_methods, t_6 )
783
C_ELM_LIST_FPL( t_6, a_flags, l_j )
784
t_4 = (EQ( t_5, t_6 ) ? True : False);
785
t_3 = t_4;
786
}
787
else {
788
CHECK_FUNC( l_match )
789
C_SUM_FIA( t_8, l_k, l_j )
790
C_SUM_FIA( t_7, t_8, INTOBJ_INT(1) )
791
CHECK_INT_POS( t_7 )
792
C_ELM_LIST_FPL( t_6, l_methods, t_7 )
793
C_ELM_LIST_FPL( t_7, a_flags, l_j )
794
t_5 = (EQ( t_6, t_7 ) ? True : False);
795
CHECK_FUNC( t_5 )
796
t_3 = NewAndFilter( l_match, t_5 );
797
}
798
l_match = t_3;
799
800
}
801
/* od */
802
803
/* if match then */
804
CHECK_BOOL( l_match )
805
t_1 = (Obj)(UInt)(l_match != False);
806
if ( t_1 ) {
807
808
/* replace := true; */
809
t_1 = True;
810
l_replace = t_1;
811
812
/* i := k; */
813
l_i = l_k;
814
815
/* break; */
816
break;
817
818
}
819
/* fi */
820
821
}
822
/* fi */
823
824
/* k := k + narg + 4; */
825
C_SUM_FIA( t_2, l_k, l_narg )
826
C_SUM_FIA( t_1, t_2, INTOBJ_INT(4) )
827
l_k = t_1;
828
829
}
830
/* od */
831
832
}
833
/* fi */
834
835
/* if not REREADING or not replace then */
836
t_4 = GC_REREADING;
837
CHECK_BOUND( t_4, "REREADING" )
838
CHECK_BOOL( t_4 )
839
t_3 = (Obj)(UInt)(t_4 != False);
840
t_2 = (Obj)(UInt)( ! ((Int)t_3) );
841
t_1 = t_2;
842
if ( ! t_1 ) {
843
t_4 = (Obj)(UInt)(l_replace != False);
844
t_3 = (Obj)(UInt)( ! ((Int)t_4) );
845
t_1 = t_3;
846
}
847
if ( t_1 ) {
848
849
/* methods{[ narg + 4 + i + 1 .. narg + 4 + LEN_LIST( methods ) ]} := methods{[ i + 1 .. LEN_LIST( methods ) ]}; */
850
C_SUM_FIA( t_4, l_narg, INTOBJ_INT(4) )
851
C_SUM_FIA( t_3, t_4, l_i )
852
C_SUM_FIA( t_2, t_3, INTOBJ_INT(1) )
853
C_SUM_FIA( t_4, l_narg, INTOBJ_INT(4) )
854
t_6 = GF_LEN__LIST;
855
t_5 = CALL_1ARGS( t_6, l_methods );
856
CHECK_FUNC_RESULT( t_5 )
857
C_SUM_FIA( t_3, t_4, t_5 )
858
t_1 = Range2Check( t_2, t_3 );
859
C_SUM_FIA( t_4, l_i, INTOBJ_INT(1) )
860
t_6 = GF_LEN__LIST;
861
t_5 = CALL_1ARGS( t_6, l_methods );
862
CHECK_FUNC_RESULT( t_5 )
863
t_3 = Range2Check( t_4, t_5 );
864
t_2 = ElmsListCheck( l_methods, t_3 );
865
AsssListCheck( l_methods, t_1, t_2 );
866
867
}
868
/* fi */
869
870
/* if rel = true then */
871
t_2 = True;
872
t_1 = (Obj)(UInt)(EQ( a_rel, t_2 ));
873
if ( t_1 ) {
874
875
/* methods[i + 1] := RETURN_TRUE; */
876
C_SUM_FIA( t_1, l_i, INTOBJ_INT(1) )
877
CHECK_INT_POS( t_1 )
878
t_2 = GC_RETURN__TRUE;
879
CHECK_BOUND( t_2, "RETURN_TRUE" )
880
C_ASS_LIST_FPL( l_methods, t_1, t_2 )
881
882
}
883
884
/* elif rel = false then */
885
else {
886
t_2 = False;
887
t_1 = (Obj)(UInt)(EQ( a_rel, t_2 ));
888
if ( t_1 ) {
889
890
/* methods[i + 1] := RETURN_FALSE; */
891
C_SUM_FIA( t_1, l_i, INTOBJ_INT(1) )
892
CHECK_INT_POS( t_1 )
893
t_2 = GC_RETURN__FALSE;
894
CHECK_BOUND( t_2, "RETURN_FALSE" )
895
C_ASS_LIST_FPL( l_methods, t_1, t_2 )
896
897
}
898
899
/* elif IS_FUNCTION( rel ) then */
900
else {
901
t_3 = GF_IS__FUNCTION;
902
t_2 = CALL_1ARGS( t_3, a_rel );
903
CHECK_FUNC_RESULT( t_2 )
904
CHECK_BOOL( t_2 )
905
t_1 = (Obj)(UInt)(t_2 != False);
906
if ( t_1 ) {
907
908
/* if CHECK_INSTALL_METHOD then */
909
t_2 = GC_CHECK__INSTALL__METHOD;
910
CHECK_BOUND( t_2, "CHECK_INSTALL_METHOD" )
911
CHECK_BOOL( t_2 )
912
t_1 = (Obj)(UInt)(t_2 != False);
913
if ( t_1 ) {
914
915
/* tmp := NARG_FUNC( rel ); */
916
t_2 = GF_NARG__FUNC;
917
t_1 = CALL_1ARGS( t_2, a_rel );
918
CHECK_FUNC_RESULT( t_1 )
919
l_tmp = t_1;
920
921
/* if tmp < AINV( narg ) - 1 or tmp >= 0 and tmp <> narg then */
922
t_5 = GF_AINV;
923
t_4 = CALL_1ARGS( t_5, l_narg );
924
CHECK_FUNC_RESULT( t_4 )
925
C_DIFF_FIA( t_3, t_4, INTOBJ_INT(1) )
926
t_2 = (Obj)(UInt)(LT( l_tmp, t_3 ));
927
t_1 = t_2;
928
if ( ! t_1 ) {
929
t_4 = (Obj)(UInt)(! LT( l_tmp, INTOBJ_INT(0) ));
930
t_3 = t_4;
931
if ( t_3 ) {
932
t_5 = (Obj)(UInt)( ! EQ( l_tmp, l_narg ));
933
t_3 = t_5;
934
}
935
t_1 = t_3;
936
}
937
if ( t_1 ) {
938
939
/* Error( NAME_FUNC( opr ), ": <famrel> must accept ", narg, " arguments" ); */
940
t_1 = GF_Error;
941
t_3 = GF_NAME__FUNC;
942
t_2 = CALL_1ARGS( t_3, a_opr );
943
CHECK_FUNC_RESULT( t_2 )
944
C_NEW_STRING( t_3, 23, ": <famrel> must accept " );
945
C_NEW_STRING( t_4, 10, " arguments" );
946
CALL_4ARGS( t_1, t_2, t_3, l_narg, t_4 );
947
948
}
949
/* fi */
950
951
}
952
/* fi */
953
954
/* methods[i + 1] := rel; */
955
C_SUM_FIA( t_1, l_i, INTOBJ_INT(1) )
956
CHECK_INT_POS( t_1 )
957
C_ASS_LIST_FPL( l_methods, t_1, a_rel )
958
959
}
960
961
/* else */
962
else {
963
964
/* Error( NAME_FUNC( opr ), ": <famrel> must be a function, `true', or `false'" ); */
965
t_1 = GF_Error;
966
t_3 = GF_NAME__FUNC;
967
t_2 = CALL_1ARGS( t_3, a_opr );
968
CHECK_FUNC_RESULT( t_2 )
969
C_NEW_STRING( t_3, 49, ": <famrel> must be a function, `true', or `false'" );
970
CALL_2ARGS( t_1, t_2, t_3 );
971
972
}
973
}
974
}
975
/* fi */
976
977
/* for k in [ 1 .. narg ] do */
978
CHECK_INT_SMALL( l_narg )
979
t_2 = l_narg;
980
for ( t_1 = INTOBJ_INT(1);
981
((Int)t_1) <= ((Int)t_2);
982
t_1 = (Obj)(((UInt)t_1)+4) ) {
983
l_k = t_1;
984
985
/* methods[i + k + 1] := flags[k]; */
986
C_SUM_FIA( t_4, l_i, l_k )
987
C_SUM_FIA( t_3, t_4, INTOBJ_INT(1) )
988
CHECK_INT_POS( t_3 )
989
C_ELM_LIST_FPL( t_4, a_flags, l_k )
990
C_ASS_LIST_FPL( l_methods, t_3, t_4 )
991
992
}
993
/* od */
994
995
/* if method = true then */
996
t_2 = True;
997
t_1 = (Obj)(UInt)(EQ( a_method, t_2 ));
998
if ( t_1 ) {
999
1000
/* methods[i + (narg + 2)] := RETURN_TRUE; */
1001
C_SUM_INTOBJS( t_2, l_narg, INTOBJ_INT(2) )
1002
C_SUM_FIA( t_1, l_i, t_2 )
1003
CHECK_INT_POS( t_1 )
1004
t_2 = GC_RETURN__TRUE;
1005
CHECK_BOUND( t_2, "RETURN_TRUE" )
1006
C_ASS_LIST_FPL( l_methods, t_1, t_2 )
1007
1008
}
1009
1010
/* elif method = false then */
1011
else {
1012
t_2 = False;
1013
t_1 = (Obj)(UInt)(EQ( a_method, t_2 ));
1014
if ( t_1 ) {
1015
1016
/* methods[i + (narg + 2)] := RETURN_FALSE; */
1017
C_SUM_INTOBJS( t_2, l_narg, INTOBJ_INT(2) )
1018
C_SUM_FIA( t_1, l_i, t_2 )
1019
CHECK_INT_POS( t_1 )
1020
t_2 = GC_RETURN__FALSE;
1021
CHECK_BOUND( t_2, "RETURN_FALSE" )
1022
C_ASS_LIST_FPL( l_methods, t_1, t_2 )
1023
1024
}
1025
1026
/* elif IS_FUNCTION( method ) then */
1027
else {
1028
t_3 = GF_IS__FUNCTION;
1029
t_2 = CALL_1ARGS( t_3, a_method );
1030
CHECK_FUNC_RESULT( t_2 )
1031
CHECK_BOOL( t_2 )
1032
t_1 = (Obj)(UInt)(t_2 != False);
1033
if ( t_1 ) {
1034
1035
/* if CHECK_INSTALL_METHOD and not IS_OPERATION( method ) then */
1036
t_3 = GC_CHECK__INSTALL__METHOD;
1037
CHECK_BOUND( t_3, "CHECK_INSTALL_METHOD" )
1038
CHECK_BOOL( t_3 )
1039
t_2 = (Obj)(UInt)(t_3 != False);
1040
t_1 = t_2;
1041
if ( t_1 ) {
1042
t_6 = GF_IS__OPERATION;
1043
t_5 = CALL_1ARGS( t_6, a_method );
1044
CHECK_FUNC_RESULT( t_5 )
1045
CHECK_BOOL( t_5 )
1046
t_4 = (Obj)(UInt)(t_5 != False);
1047
t_3 = (Obj)(UInt)( ! ((Int)t_4) );
1048
t_1 = t_3;
1049
}
1050
if ( t_1 ) {
1051
1052
/* tmp := NARG_FUNC( method ); */
1053
t_2 = GF_NARG__FUNC;
1054
t_1 = CALL_1ARGS( t_2, a_method );
1055
CHECK_FUNC_RESULT( t_1 )
1056
l_tmp = t_1;
1057
1058
/* if tmp < AINV( narg ) - 1 or tmp >= 0 and tmp <> narg then */
1059
t_5 = GF_AINV;
1060
t_4 = CALL_1ARGS( t_5, l_narg );
1061
CHECK_FUNC_RESULT( t_4 )
1062
C_DIFF_FIA( t_3, t_4, INTOBJ_INT(1) )
1063
t_2 = (Obj)(UInt)(LT( l_tmp, t_3 ));
1064
t_1 = t_2;
1065
if ( ! t_1 ) {
1066
t_4 = (Obj)(UInt)(! LT( l_tmp, INTOBJ_INT(0) ));
1067
t_3 = t_4;
1068
if ( t_3 ) {
1069
t_5 = (Obj)(UInt)( ! EQ( l_tmp, l_narg ));
1070
t_3 = t_5;
1071
}
1072
t_1 = t_3;
1073
}
1074
if ( t_1 ) {
1075
1076
/* Error( NAME_FUNC( opr ), ": <method> must accept ", narg, " arguments" ); */
1077
t_1 = GF_Error;
1078
t_3 = GF_NAME__FUNC;
1079
t_2 = CALL_1ARGS( t_3, a_opr );
1080
CHECK_FUNC_RESULT( t_2 )
1081
C_NEW_STRING( t_3, 23, ": <method> must accept " );
1082
C_NEW_STRING( t_4, 10, " arguments" );
1083
CALL_4ARGS( t_1, t_2, t_3, l_narg, t_4 );
1084
1085
}
1086
/* fi */
1087
1088
}
1089
/* fi */
1090
1091
/* methods[i + (narg + 2)] := method; */
1092
C_SUM_INTOBJS( t_2, l_narg, INTOBJ_INT(2) )
1093
C_SUM_FIA( t_1, l_i, t_2 )
1094
CHECK_INT_POS( t_1 )
1095
C_ASS_LIST_FPL( l_methods, t_1, a_method )
1096
1097
}
1098
1099
/* else */
1100
else {
1101
1102
/* Error( NAME_FUNC( opr ), ": <method> must be a function, `true', or `false'" ); */
1103
t_1 = GF_Error;
1104
t_3 = GF_NAME__FUNC;
1105
t_2 = CALL_1ARGS( t_3, a_opr );
1106
CHECK_FUNC_RESULT( t_2 )
1107
C_NEW_STRING( t_3, 49, ": <method> must be a function, `true', or `false'" );
1108
CALL_2ARGS( t_1, t_2, t_3 );
1109
1110
}
1111
}
1112
}
1113
/* fi */
1114
1115
/* methods[i + (narg + 3)] := rank; */
1116
C_SUM_INTOBJS( t_2, l_narg, INTOBJ_INT(3) )
1117
C_SUM_FIA( t_1, l_i, t_2 )
1118
CHECK_INT_POS( t_1 )
1119
C_ASS_LIST_FPL( l_methods, t_1, a_rank )
1120
1121
/* methods[i + (narg + 4)] := IMMUTABLE_COPY_OBJ( info ); */
1122
C_SUM_INTOBJS( t_2, l_narg, INTOBJ_INT(4) )
1123
C_SUM_FIA( t_1, l_i, t_2 )
1124
CHECK_INT_POS( t_1 )
1125
t_3 = GF_IMMUTABLE__COPY__OBJ;
1126
t_2 = CALL_1ARGS( t_3, a_info );
1127
CHECK_FUNC_RESULT( t_2 )
1128
C_ASS_LIST_FPL( l_methods, t_1, t_2 )
1129
1130
/* CHANGED_METHODS_OPERATION( opr, narg ); */
1131
t_1 = GF_CHANGED__METHODS__OPERATION;
1132
CALL_2ARGS( t_1, a_opr, l_narg );
1133
1134
/* return; */
1135
RES_BRK_CURR_STAT();
1136
SWITCH_TO_OLD_FRAME(oldFrame);
1137
return 0;
1138
1139
/* return; */
1140
RES_BRK_CURR_STAT();
1141
SWITCH_TO_OLD_FRAME(oldFrame);
1142
return 0;
1143
}
1144
1145
/* handler for function 4 */
1146
static Obj HdlrFunc4 (
1147
Obj self,
1148
Obj a_arg )
1149
{
1150
Obj t_1 = 0;
1151
Obj t_2 = 0;
1152
Bag oldFrame;
1153
OLD_BRK_CURR_STAT
1154
1155
/* allocate new stack frame */
1156
SWITCH_TO_NEW_FRAME(self,0,0,oldFrame);
1157
REM_BRK_CURR_STAT();
1158
SET_BRK_CURR_STAT(0);
1159
1160
/* INSTALL_METHOD( arg, true ); */
1161
t_1 = GF_INSTALL__METHOD;
1162
t_2 = True;
1163
CALL_2ARGS( t_1, a_arg, t_2 );
1164
1165
/* return; */
1166
RES_BRK_CURR_STAT();
1167
SWITCH_TO_OLD_FRAME(oldFrame);
1168
return 0;
1169
1170
/* return; */
1171
RES_BRK_CURR_STAT();
1172
SWITCH_TO_OLD_FRAME(oldFrame);
1173
return 0;
1174
}
1175
1176
/* handler for function 5 */
1177
static Obj HdlrFunc5 (
1178
Obj self,
1179
Obj a_arg )
1180
{
1181
Obj t_1 = 0;
1182
Obj t_2 = 0;
1183
Bag oldFrame;
1184
OLD_BRK_CURR_STAT
1185
1186
/* allocate new stack frame */
1187
SWITCH_TO_NEW_FRAME(self,0,0,oldFrame);
1188
REM_BRK_CURR_STAT();
1189
SET_BRK_CURR_STAT(0);
1190
1191
/* INSTALL_METHOD( arg, false ); */
1192
t_1 = GF_INSTALL__METHOD;
1193
t_2 = False;
1194
CALL_2ARGS( t_1, a_arg, t_2 );
1195
1196
/* return; */
1197
RES_BRK_CURR_STAT();
1198
SWITCH_TO_OLD_FRAME(oldFrame);
1199
return 0;
1200
1201
/* return; */
1202
RES_BRK_CURR_STAT();
1203
SWITCH_TO_OLD_FRAME(oldFrame);
1204
return 0;
1205
}
1206
1207
/* handler for function 6 */
1208
static Obj HdlrFunc6 (
1209
Obj self,
1210
Obj a_arglist,
1211
Obj a_check )
1212
{
1213
Obj l_len = 0;
1214
Obj l_opr = 0;
1215
Obj l_info = 0;
1216
Obj l_pos = 0;
1217
Obj l_rel = 0;
1218
Obj l_filters = 0;
1219
Obj l_info1 = 0;
1220
Obj l_isstr = 0;
1221
Obj l_flags = 0;
1222
Obj l_i = 0;
1223
Obj l_rank = 0;
1224
Obj l_method = 0;
1225
Obj l_req = 0;
1226
Obj l_reqs = 0;
1227
Obj l_match = 0;
1228
Obj l_j = 0;
1229
Obj l_k = 0;
1230
Obj l_imp = 0;
1231
Obj l_notmatch = 0;
1232
Obj t_1 = 0;
1233
Obj t_2 = 0;
1234
Obj t_3 = 0;
1235
Obj t_4 = 0;
1236
Obj t_5 = 0;
1237
Obj t_6 = 0;
1238
Obj t_7 = 0;
1239
Obj t_8 = 0;
1240
Obj t_9 = 0;
1241
Obj t_10 = 0;
1242
Obj t_11 = 0;
1243
Bag oldFrame;
1244
OLD_BRK_CURR_STAT
1245
1246
/* allocate new stack frame */
1247
SWITCH_TO_NEW_FRAME(self,0,0,oldFrame);
1248
REM_BRK_CURR_STAT();
1249
SET_BRK_CURR_STAT(0);
1250
1251
/* len := LEN_LIST( arglist ); */
1252
t_2 = GF_LEN__LIST;
1253
t_1 = CALL_1ARGS( t_2, a_arglist );
1254
CHECK_FUNC_RESULT( t_1 )
1255
l_len = t_1;
1256
1257
/* if len < 3 then */
1258
t_1 = (Obj)(UInt)(LT( l_len, INTOBJ_INT(3) ));
1259
if ( t_1 ) {
1260
1261
/* Error( "too few arguments given in <arglist>" ); */
1262
t_1 = GF_Error;
1263
C_NEW_STRING( t_2, 36, "too few arguments given in <arglist>" );
1264
CALL_1ARGS( t_1, t_2 );
1265
1266
}
1267
/* fi */
1268
1269
/* opr := arglist[1]; */
1270
C_ELM_LIST_FPL( t_1, a_arglist, INTOBJ_INT(1) )
1271
l_opr = t_1;
1272
1273
/* if not IS_OPERATION( opr ) then */
1274
t_4 = GF_IS__OPERATION;
1275
t_3 = CALL_1ARGS( t_4, l_opr );
1276
CHECK_FUNC_RESULT( t_3 )
1277
CHECK_BOOL( t_3 )
1278
t_2 = (Obj)(UInt)(t_3 != False);
1279
t_1 = (Obj)(UInt)( ! ((Int)t_2) );
1280
if ( t_1 ) {
1281
1282
/* Error( "<opr> is not an operation" ); */
1283
t_1 = GF_Error;
1284
C_NEW_STRING( t_2, 25, "<opr> is not an operation" );
1285
CALL_1ARGS( t_1, t_2 );
1286
1287
}
1288
/* fi */
1289
1290
/* if IS_STRING_REP( arglist[2] ) then */
1291
t_3 = GF_IS__STRING__REP;
1292
C_ELM_LIST_FPL( t_4, a_arglist, INTOBJ_INT(2) )
1293
t_2 = CALL_1ARGS( t_3, t_4 );
1294
CHECK_FUNC_RESULT( t_2 )
1295
CHECK_BOOL( t_2 )
1296
t_1 = (Obj)(UInt)(t_2 != False);
1297
if ( t_1 ) {
1298
1299
/* info := arglist[2]; */
1300
C_ELM_LIST_FPL( t_1, a_arglist, INTOBJ_INT(2) )
1301
l_info = t_1;
1302
1303
/* pos := 3; */
1304
l_pos = INTOBJ_INT(3);
1305
1306
}
1307
1308
/* else */
1309
else {
1310
1311
/* info := false; */
1312
t_1 = False;
1313
l_info = t_1;
1314
1315
/* pos := 2; */
1316
l_pos = INTOBJ_INT(2);
1317
1318
}
1319
/* fi */
1320
1321
/* if arglist[pos] = true or IS_FUNCTION( arglist[pos] ) then */
1322
C_ELM_LIST_FPL( t_3, a_arglist, l_pos )
1323
t_4 = True;
1324
t_2 = (Obj)(UInt)(EQ( t_3, t_4 ));
1325
t_1 = t_2;
1326
if ( ! t_1 ) {
1327
t_5 = GF_IS__FUNCTION;
1328
C_ELM_LIST_FPL( t_6, a_arglist, l_pos )
1329
t_4 = CALL_1ARGS( t_5, t_6 );
1330
CHECK_FUNC_RESULT( t_4 )
1331
CHECK_BOOL( t_4 )
1332
t_3 = (Obj)(UInt)(t_4 != False);
1333
t_1 = t_3;
1334
}
1335
if ( t_1 ) {
1336
1337
/* rel := arglist[pos]; */
1338
C_ELM_LIST_FPL( t_1, a_arglist, l_pos )
1339
l_rel = t_1;
1340
1341
/* pos := pos + 1; */
1342
C_SUM_INTOBJS( t_1, l_pos, INTOBJ_INT(1) )
1343
l_pos = t_1;
1344
1345
}
1346
1347
/* else */
1348
else {
1349
1350
/* rel := true; */
1351
t_1 = True;
1352
l_rel = t_1;
1353
1354
}
1355
/* fi */
1356
1357
/* if not IsBound( arglist[pos] ) or not IS_LIST( arglist[pos] ) then */
1358
CHECK_INT_POS( l_pos )
1359
t_4 = C_ISB_LIST( a_arglist, l_pos );
1360
t_3 = (Obj)(UInt)(t_4 != False);
1361
t_2 = (Obj)(UInt)( ! ((Int)t_3) );
1362
t_1 = t_2;
1363
if ( ! t_1 ) {
1364
t_6 = GF_IS__LIST;
1365
C_ELM_LIST_FPL( t_7, a_arglist, l_pos )
1366
t_5 = CALL_1ARGS( t_6, t_7 );
1367
CHECK_FUNC_RESULT( t_5 )
1368
CHECK_BOOL( t_5 )
1369
t_4 = (Obj)(UInt)(t_5 != False);
1370
t_3 = (Obj)(UInt)( ! ((Int)t_4) );
1371
t_1 = t_3;
1372
}
1373
if ( t_1 ) {
1374
1375
/* Error( "<arglist>[", pos, "] must be a list of filters" ); */
1376
t_1 = GF_Error;
1377
C_NEW_STRING( t_2, 10, "<arglist>[" );
1378
C_NEW_STRING( t_3, 27, "] must be a list of filters" );
1379
CALL_3ARGS( t_1, t_2, l_pos, t_3 );
1380
1381
}
1382
/* fi */
1383
1384
/* filters := arglist[pos]; */
1385
C_ELM_LIST_FPL( t_1, a_arglist, l_pos )
1386
l_filters = t_1;
1387
1388
/* if GAPInfo.MaxNrArgsMethod < LEN_LIST( filters ) then */
1389
t_3 = GC_GAPInfo;
1390
CHECK_BOUND( t_3, "GAPInfo" )
1391
t_2 = ELM_REC( t_3, R_MaxNrArgsMethod );
1392
t_4 = GF_LEN__LIST;
1393
t_3 = CALL_1ARGS( t_4, l_filters );
1394
CHECK_FUNC_RESULT( t_3 )
1395
t_1 = (Obj)(UInt)(LT( t_2, t_3 ));
1396
if ( t_1 ) {
1397
1398
/* Error( "methods can have at most ", GAPInfo.MaxNrArgsMethod, " arguments" ); */
1399
t_1 = GF_Error;
1400
C_NEW_STRING( t_2, 25, "methods can have at most " );
1401
t_4 = GC_GAPInfo;
1402
CHECK_BOUND( t_4, "GAPInfo" )
1403
t_3 = ELM_REC( t_4, R_MaxNrArgsMethod );
1404
C_NEW_STRING( t_4, 10, " arguments" );
1405
CALL_3ARGS( t_1, t_2, t_3, t_4 );
1406
1407
}
1408
/* fi */
1409
1410
/* if 0 < LEN_LIST( filters ) then */
1411
t_3 = GF_LEN__LIST;
1412
t_2 = CALL_1ARGS( t_3, l_filters );
1413
CHECK_FUNC_RESULT( t_2 )
1414
t_1 = (Obj)(UInt)(LT( INTOBJ_INT(0), t_2 ));
1415
if ( t_1 ) {
1416
1417
/* info1 := "[ "; */
1418
C_NEW_STRING( t_1, 2, "[ " );
1419
l_info1 = t_1;
1420
1421
/* isstr := true; */
1422
t_1 = True;
1423
l_isstr = t_1;
1424
1425
/* for i in [ 1 .. LEN_LIST( filters ) ] do */
1426
t_3 = GF_LEN__LIST;
1427
t_2 = CALL_1ARGS( t_3, l_filters );
1428
CHECK_FUNC_RESULT( t_2 )
1429
CHECK_INT_SMALL( t_2 )
1430
for ( t_1 = INTOBJ_INT(1);
1431
((Int)t_1) <= ((Int)t_2);
1432
t_1 = (Obj)(((UInt)t_1)+4) ) {
1433
l_i = t_1;
1434
1435
/* if IS_STRING_REP( filters[i] ) then */
1436
t_5 = GF_IS__STRING__REP;
1437
C_ELM_LIST_FPL( t_6, l_filters, l_i )
1438
t_4 = CALL_1ARGS( t_5, t_6 );
1439
CHECK_FUNC_RESULT( t_4 )
1440
CHECK_BOOL( t_4 )
1441
t_3 = (Obj)(UInt)(t_4 != False);
1442
if ( t_3 ) {
1443
1444
/* APPEND_LIST_INTR( info1, filters[i] ); */
1445
t_3 = GF_APPEND__LIST__INTR;
1446
C_ELM_LIST_FPL( t_4, l_filters, l_i )
1447
CALL_2ARGS( t_3, l_info1, t_4 );
1448
1449
/* APPEND_LIST_INTR( info1, ", " ); */
1450
t_3 = GF_APPEND__LIST__INTR;
1451
C_NEW_STRING( t_4, 2, ", " );
1452
CALL_2ARGS( t_3, l_info1, t_4 );
1453
1454
/* filters[i] := EvalString( filters[i] ); */
1455
t_4 = GF_EvalString;
1456
C_ELM_LIST_FPL( t_5, l_filters, l_i )
1457
t_3 = CALL_1ARGS( t_4, t_5 );
1458
CHECK_FUNC_RESULT( t_3 )
1459
C_ASS_LIST_FPL( l_filters, l_i, t_3 )
1460
1461
/* if not IS_FUNCTION( filters[i] ) then */
1462
t_6 = GF_IS__FUNCTION;
1463
C_ELM_LIST_FPL( t_7, l_filters, l_i )
1464
t_5 = CALL_1ARGS( t_6, t_7 );
1465
CHECK_FUNC_RESULT( t_5 )
1466
CHECK_BOOL( t_5 )
1467
t_4 = (Obj)(UInt)(t_5 != False);
1468
t_3 = (Obj)(UInt)( ! ((Int)t_4) );
1469
if ( t_3 ) {
1470
1471
/* Error( "string does not evaluate to a function" ); */
1472
t_3 = GF_Error;
1473
C_NEW_STRING( t_4, 38, "string does not evaluate to a function" );
1474
CALL_1ARGS( t_3, t_4 );
1475
1476
}
1477
/* fi */
1478
1479
}
1480
1481
/* else */
1482
else {
1483
1484
/* isstr := false; */
1485
t_3 = False;
1486
l_isstr = t_3;
1487
1488
/* break; */
1489
break;
1490
1491
}
1492
/* fi */
1493
1494
}
1495
/* od */
1496
1497
/* if isstr and info = false then */
1498
t_2 = (Obj)(UInt)(l_isstr != False);
1499
t_1 = t_2;
1500
if ( t_1 ) {
1501
t_4 = False;
1502
t_3 = (Obj)(UInt)(EQ( l_info, t_4 ));
1503
t_1 = t_3;
1504
}
1505
if ( t_1 ) {
1506
1507
/* info1[LEN_LIST( info1 ) - 1] := ' '; */
1508
t_3 = GF_LEN__LIST;
1509
t_2 = CALL_1ARGS( t_3, l_info1 );
1510
CHECK_FUNC_RESULT( t_2 )
1511
C_DIFF_FIA( t_1, t_2, INTOBJ_INT(1) )
1512
CHECK_INT_POS( t_1 )
1513
t_2 = ObjsChar[32];
1514
C_ASS_LIST_FPL( l_info1, t_1, t_2 )
1515
1516
/* info1[LEN_LIST( info1 )] := ']'; */
1517
t_2 = GF_LEN__LIST;
1518
t_1 = CALL_1ARGS( t_2, l_info1 );
1519
CHECK_FUNC_RESULT( t_1 )
1520
CHECK_INT_POS( t_1 )
1521
t_2 = ObjsChar[93];
1522
C_ASS_LIST_FPL( l_info1, t_1, t_2 )
1523
1524
/* info := info1; */
1525
l_info = l_info1;
1526
1527
}
1528
/* fi */
1529
1530
}
1531
/* fi */
1532
1533
/* pos := pos + 1; */
1534
C_SUM_FIA( t_1, l_pos, INTOBJ_INT(1) )
1535
l_pos = t_1;
1536
1537
/* flags := [ ]; */
1538
t_1 = NEW_PLIST( T_PLIST, 0 );
1539
SET_LEN_PLIST( t_1, 0 );
1540
l_flags = t_1;
1541
1542
/* for i in filters do */
1543
t_4 = l_filters;
1544
if ( IS_SMALL_LIST(t_4) ) {
1545
t_3 = (Obj)(UInt)1;
1546
t_1 = INTOBJ_INT(1);
1547
}
1548
else {
1549
t_3 = (Obj)(UInt)0;
1550
t_1 = CALL_1ARGS( GF_ITERATOR, t_4 );
1551
}
1552
while ( 1 ) {
1553
if ( t_3 ) {
1554
if ( LEN_LIST(t_4) < INT_INTOBJ(t_1) ) break;
1555
t_2 = ELMV0_LIST( t_4, INT_INTOBJ(t_1) );
1556
t_1 = (Obj)(((UInt)t_1)+4);
1557
if ( t_2 == 0 ) continue;
1558
}
1559
else {
1560
if ( CALL_1ARGS( GF_IS_DONE_ITER, t_1 ) != False ) break;
1561
t_2 = CALL_1ARGS( GF_NEXT_ITER, t_1 );
1562
}
1563
l_i = t_2;
1564
1565
/* ADD_LIST( flags, FLAGS_FILTER( i ) ); */
1566
t_5 = GF_ADD__LIST;
1567
t_7 = GF_FLAGS__FILTER;
1568
t_6 = CALL_1ARGS( t_7, l_i );
1569
CHECK_FUNC_RESULT( t_6 )
1570
CALL_2ARGS( t_5, l_flags, t_6 );
1571
1572
}
1573
/* od */
1574
1575
/* if not IsBound( arglist[pos] ) then */
1576
CHECK_INT_POS( l_pos )
1577
t_3 = C_ISB_LIST( a_arglist, l_pos );
1578
t_2 = (Obj)(UInt)(t_3 != False);
1579
t_1 = (Obj)(UInt)( ! ((Int)t_2) );
1580
if ( t_1 ) {
1581
1582
/* Error( "the method is missing in <arglist>" ); */
1583
t_1 = GF_Error;
1584
C_NEW_STRING( t_2, 34, "the method is missing in <arglist>" );
1585
CALL_1ARGS( t_1, t_2 );
1586
1587
}
1588
1589
/* elif IS_INT( arglist[pos] ) then */
1590
else {
1591
t_3 = GF_IS__INT;
1592
C_ELM_LIST_FPL( t_4, a_arglist, l_pos )
1593
t_2 = CALL_1ARGS( t_3, t_4 );
1594
CHECK_FUNC_RESULT( t_2 )
1595
CHECK_BOOL( t_2 )
1596
t_1 = (Obj)(UInt)(t_2 != False);
1597
if ( t_1 ) {
1598
1599
/* rank := arglist[pos]; */
1600
C_ELM_LIST_FPL( t_1, a_arglist, l_pos )
1601
l_rank = t_1;
1602
1603
/* pos := pos + 1; */
1604
C_SUM_FIA( t_1, l_pos, INTOBJ_INT(1) )
1605
l_pos = t_1;
1606
1607
}
1608
1609
/* else */
1610
else {
1611
1612
/* rank := 0; */
1613
l_rank = INTOBJ_INT(0);
1614
1615
}
1616
}
1617
/* fi */
1618
1619
/* if not IsBound( arglist[pos] ) then */
1620
CHECK_INT_POS( l_pos )
1621
t_3 = C_ISB_LIST( a_arglist, l_pos );
1622
t_2 = (Obj)(UInt)(t_3 != False);
1623
t_1 = (Obj)(UInt)( ! ((Int)t_2) );
1624
if ( t_1 ) {
1625
1626
/* Error( "the method is missing in <arglist>" ); */
1627
t_1 = GF_Error;
1628
C_NEW_STRING( t_2, 34, "the method is missing in <arglist>" );
1629
CALL_1ARGS( t_1, t_2 );
1630
1631
}
1632
/* fi */
1633
1634
/* method := arglist[pos]; */
1635
C_ELM_LIST_FPL( t_1, a_arglist, l_pos )
1636
l_method = t_1;
1637
1638
/* if FLAG1_FILTER( opr ) <> 0 and (rel = true or rel = RETURN_TRUE) and LEN_LIST( filters ) = 1 and (method = true or method = RETURN_TRUE) then */
1639
t_6 = GF_FLAG1__FILTER;
1640
t_5 = CALL_1ARGS( t_6, l_opr );
1641
CHECK_FUNC_RESULT( t_5 )
1642
t_4 = (Obj)(UInt)( ! EQ( t_5, INTOBJ_INT(0) ));
1643
t_3 = t_4;
1644
if ( t_3 ) {
1645
t_7 = True;
1646
t_6 = (Obj)(UInt)(EQ( l_rel, t_7 ));
1647
t_5 = t_6;
1648
if ( ! t_5 ) {
1649
t_8 = GC_RETURN__TRUE;
1650
CHECK_BOUND( t_8, "RETURN_TRUE" )
1651
t_7 = (Obj)(UInt)(EQ( l_rel, t_8 ));
1652
t_5 = t_7;
1653
}
1654
t_3 = t_5;
1655
}
1656
t_2 = t_3;
1657
if ( t_2 ) {
1658
t_6 = GF_LEN__LIST;
1659
t_5 = CALL_1ARGS( t_6, l_filters );
1660
CHECK_FUNC_RESULT( t_5 )
1661
t_4 = (Obj)(UInt)(EQ( t_5, INTOBJ_INT(1) ));
1662
t_2 = t_4;
1663
}
1664
t_1 = t_2;
1665
if ( t_1 ) {
1666
t_5 = True;
1667
t_4 = (Obj)(UInt)(EQ( l_method, t_5 ));
1668
t_3 = t_4;
1669
if ( ! t_3 ) {
1670
t_6 = GC_RETURN__TRUE;
1671
CHECK_BOUND( t_6, "RETURN_TRUE" )
1672
t_5 = (Obj)(UInt)(EQ( l_method, t_6 ));
1673
t_3 = t_5;
1674
}
1675
t_1 = t_3;
1676
}
1677
if ( t_1 ) {
1678
1679
/* Error( NAME_FUNC( opr ), ": use `InstallTrueMethod' for <opr>" ); */
1680
t_1 = GF_Error;
1681
t_3 = GF_NAME__FUNC;
1682
t_2 = CALL_1ARGS( t_3, l_opr );
1683
CHECK_FUNC_RESULT( t_2 )
1684
C_NEW_STRING( t_3, 35, ": use `InstallTrueMethod' for <opr>" );
1685
CALL_2ARGS( t_1, t_2, t_3 );
1686
1687
}
1688
/* fi */
1689
1690
/* if CHECK_INSTALL_METHOD and check then */
1691
t_3 = GC_CHECK__INSTALL__METHOD;
1692
CHECK_BOUND( t_3, "CHECK_INSTALL_METHOD" )
1693
CHECK_BOOL( t_3 )
1694
t_2 = (Obj)(UInt)(t_3 != False);
1695
t_1 = t_2;
1696
if ( t_1 ) {
1697
CHECK_BOOL( a_check )
1698
t_3 = (Obj)(UInt)(a_check != False);
1699
t_1 = t_3;
1700
}
1701
if ( t_1 ) {
1702
1703
/* if opr in WRAPPER_OPERATIONS then */
1704
t_2 = GC_WRAPPER__OPERATIONS;
1705
CHECK_BOUND( t_2, "WRAPPER_OPERATIONS" )
1706
t_1 = (Obj)(UInt)(IN( l_opr, t_2 ));
1707
if ( t_1 ) {
1708
1709
/* INFO_DEBUG( 1, "a method is installed for the wrapper operation ", NAME_FUNC( opr ), "\n", "#I probably it should be installed for (one of) its\n", "#I underlying operation(s)" ); */
1710
t_1 = GF_INFO__DEBUG;
1711
C_NEW_STRING( t_2, 48, "a method is installed for the wrapper operation " );
1712
t_4 = GF_NAME__FUNC;
1713
t_3 = CALL_1ARGS( t_4, l_opr );
1714
CHECK_FUNC_RESULT( t_3 )
1715
C_NEW_STRING( t_4, 1, "\n" );
1716
C_NEW_STRING( t_5, 53, "#I probably it should be installed for (one of) its\n" );
1717
C_NEW_STRING( t_6, 27, "#I underlying operation(s)" );
1718
CALL_6ARGS( t_1, INTOBJ_INT(1), t_2, t_3, t_4, t_5, t_6 );
1719
1720
}
1721
/* fi */
1722
1723
/* req := false; */
1724
t_1 = False;
1725
l_req = t_1;
1726
1727
/* for i in [ 1, 3 .. LEN_LIST( OPERATIONS ) - 1 ] do */
1728
t_7 = GF_LEN__LIST;
1729
t_8 = GC_OPERATIONS;
1730
CHECK_BOUND( t_8, "OPERATIONS" )
1731
t_6 = CALL_1ARGS( t_7, t_8 );
1732
CHECK_FUNC_RESULT( t_6 )
1733
C_DIFF_FIA( t_5, t_6, INTOBJ_INT(1) )
1734
t_4 = Range3Check( INTOBJ_INT(1), INTOBJ_INT(3), t_5 );
1735
if ( IS_SMALL_LIST(t_4) ) {
1736
t_3 = (Obj)(UInt)1;
1737
t_1 = INTOBJ_INT(1);
1738
}
1739
else {
1740
t_3 = (Obj)(UInt)0;
1741
t_1 = CALL_1ARGS( GF_ITERATOR, t_4 );
1742
}
1743
while ( 1 ) {
1744
if ( t_3 ) {
1745
if ( LEN_LIST(t_4) < INT_INTOBJ(t_1) ) break;
1746
t_2 = ELMV0_LIST( t_4, INT_INTOBJ(t_1) );
1747
t_1 = (Obj)(((UInt)t_1)+4);
1748
if ( t_2 == 0 ) continue;
1749
}
1750
else {
1751
if ( CALL_1ARGS( GF_IS_DONE_ITER, t_1 ) != False ) break;
1752
t_2 = CALL_1ARGS( GF_NEXT_ITER, t_1 );
1753
}
1754
l_i = t_2;
1755
1756
/* if IS_IDENTICAL_OBJ( OPERATIONS[i], opr ) then */
1757
t_7 = GF_IS__IDENTICAL__OBJ;
1758
t_9 = GC_OPERATIONS;
1759
CHECK_BOUND( t_9, "OPERATIONS" )
1760
CHECK_INT_POS( l_i )
1761
C_ELM_LIST_FPL( t_8, t_9, l_i )
1762
t_6 = CALL_2ARGS( t_7, t_8, l_opr );
1763
CHECK_FUNC_RESULT( t_6 )
1764
CHECK_BOOL( t_6 )
1765
t_5 = (Obj)(UInt)(t_6 != False);
1766
if ( t_5 ) {
1767
1768
/* req := OPERATIONS[i + 1]; */
1769
t_6 = GC_OPERATIONS;
1770
CHECK_BOUND( t_6, "OPERATIONS" )
1771
C_SUM_FIA( t_7, l_i, INTOBJ_INT(1) )
1772
CHECK_INT_POS( t_7 )
1773
C_ELM_LIST_FPL( t_5, t_6, t_7 )
1774
l_req = t_5;
1775
1776
/* break; */
1777
break;
1778
1779
}
1780
/* fi */
1781
1782
}
1783
/* od */
1784
1785
/* if req = false then */
1786
t_2 = False;
1787
t_1 = (Obj)(UInt)(EQ( l_req, t_2 ));
1788
if ( t_1 ) {
1789
1790
/* Error( "unknown operation ", NAME_FUNC( opr ) ); */
1791
t_1 = GF_Error;
1792
C_NEW_STRING( t_2, 18, "unknown operation " );
1793
t_4 = GF_NAME__FUNC;
1794
t_3 = CALL_1ARGS( t_4, l_opr );
1795
CHECK_FUNC_RESULT( t_3 )
1796
CALL_2ARGS( t_1, t_2, t_3 );
1797
1798
}
1799
/* fi */
1800
1801
/* imp := [ ]; */
1802
t_1 = NEW_PLIST( T_PLIST, 0 );
1803
SET_LEN_PLIST( t_1, 0 );
1804
l_imp = t_1;
1805
1806
/* for i in flags do */
1807
t_4 = l_flags;
1808
if ( IS_SMALL_LIST(t_4) ) {
1809
t_3 = (Obj)(UInt)1;
1810
t_1 = INTOBJ_INT(1);
1811
}
1812
else {
1813
t_3 = (Obj)(UInt)0;
1814
t_1 = CALL_1ARGS( GF_ITERATOR, t_4 );
1815
}
1816
while ( 1 ) {
1817
if ( t_3 ) {
1818
if ( LEN_LIST(t_4) < INT_INTOBJ(t_1) ) break;
1819
t_2 = ELMV0_LIST( t_4, INT_INTOBJ(t_1) );
1820
t_1 = (Obj)(((UInt)t_1)+4);
1821
if ( t_2 == 0 ) continue;
1822
}
1823
else {
1824
if ( CALL_1ARGS( GF_IS_DONE_ITER, t_1 ) != False ) break;
1825
t_2 = CALL_1ARGS( GF_NEXT_ITER, t_1 );
1826
}
1827
l_i = t_2;
1828
1829
/* ADD_LIST( imp, WITH_HIDDEN_IMPS_FLAGS( i ) ); */
1830
t_5 = GF_ADD__LIST;
1831
t_7 = GF_WITH__HIDDEN__IMPS__FLAGS;
1832
t_6 = CALL_1ARGS( t_7, l_i );
1833
CHECK_FUNC_RESULT( t_6 )
1834
CALL_2ARGS( t_5, l_imp, t_6 );
1835
1836
}
1837
/* od */
1838
1839
/* j := 0; */
1840
l_j = INTOBJ_INT(0);
1841
1842
/* match := false; */
1843
t_1 = False;
1844
l_match = t_1;
1845
1846
/* notmatch := 0; */
1847
l_notmatch = INTOBJ_INT(0);
1848
1849
/* while j < LEN_LIST( req ) and not match od */
1850
while ( 1 ) {
1851
t_4 = GF_LEN__LIST;
1852
t_3 = CALL_1ARGS( t_4, l_req );
1853
CHECK_FUNC_RESULT( t_3 )
1854
t_2 = (Obj)(UInt)(LT( l_j, t_3 ));
1855
t_1 = t_2;
1856
if ( t_1 ) {
1857
t_4 = (Obj)(UInt)(l_match != False);
1858
t_3 = (Obj)(UInt)( ! ((Int)t_4) );
1859
t_1 = t_3;
1860
}
1861
if ( ! t_1 ) break;
1862
1863
/* j := j + 1; */
1864
C_SUM_FIA( t_1, l_j, INTOBJ_INT(1) )
1865
l_j = t_1;
1866
1867
/* reqs := req[j]; */
1868
CHECK_INT_POS( l_j )
1869
C_ELM_LIST_FPL( t_1, l_req, l_j )
1870
l_reqs = t_1;
1871
1872
/* if LEN_LIST( reqs ) = LEN_LIST( imp ) then */
1873
t_3 = GF_LEN__LIST;
1874
t_2 = CALL_1ARGS( t_3, l_reqs );
1875
CHECK_FUNC_RESULT( t_2 )
1876
t_4 = GF_LEN__LIST;
1877
t_3 = CALL_1ARGS( t_4, l_imp );
1878
CHECK_FUNC_RESULT( t_3 )
1879
t_1 = (Obj)(UInt)(EQ( t_2, t_3 ));
1880
if ( t_1 ) {
1881
1882
/* match := true; */
1883
t_1 = True;
1884
l_match = t_1;
1885
1886
/* for i in [ 1 .. LEN_LIST( reqs ) ] do */
1887
t_3 = GF_LEN__LIST;
1888
t_2 = CALL_1ARGS( t_3, l_reqs );
1889
CHECK_FUNC_RESULT( t_2 )
1890
CHECK_INT_SMALL( t_2 )
1891
for ( t_1 = INTOBJ_INT(1);
1892
((Int)t_1) <= ((Int)t_2);
1893
t_1 = (Obj)(((UInt)t_1)+4) ) {
1894
l_i = t_1;
1895
1896
/* if not IS_SUBSET_FLAGS( imp[i], reqs[i] ) then */
1897
t_6 = GF_IS__SUBSET__FLAGS;
1898
C_ELM_LIST_FPL( t_7, l_imp, l_i )
1899
C_ELM_LIST_FPL( t_8, l_reqs, l_i )
1900
t_5 = CALL_2ARGS( t_6, t_7, t_8 );
1901
CHECK_FUNC_RESULT( t_5 )
1902
CHECK_BOOL( t_5 )
1903
t_4 = (Obj)(UInt)(t_5 != False);
1904
t_3 = (Obj)(UInt)( ! ((Int)t_4) );
1905
if ( t_3 ) {
1906
1907
/* match := false; */
1908
t_3 = False;
1909
l_match = t_3;
1910
1911
/* notmatch := i; */
1912
l_notmatch = l_i;
1913
1914
/* break; */
1915
break;
1916
1917
}
1918
/* fi */
1919
1920
}
1921
/* od */
1922
1923
/* if match then */
1924
t_1 = (Obj)(UInt)(l_match != False);
1925
if ( t_1 ) {
1926
1927
/* break; */
1928
break;
1929
1930
}
1931
/* fi */
1932
1933
}
1934
/* fi */
1935
1936
}
1937
/* od */
1938
1939
/* if not match then */
1940
t_2 = (Obj)(UInt)(l_match != False);
1941
t_1 = (Obj)(UInt)( ! ((Int)t_2) );
1942
if ( t_1 ) {
1943
1944
/* if notmatch = 0 then */
1945
t_1 = (Obj)(UInt)(((Int)l_notmatch) == ((Int)INTOBJ_INT(0)));
1946
if ( t_1 ) {
1947
1948
/* Error( "the number of arguments does not match a declaration of ", NAME_FUNC( opr ) ); */
1949
t_1 = GF_Error;
1950
C_NEW_STRING( t_2, 56, "the number of arguments does not match a declaration of " );
1951
t_4 = GF_NAME__FUNC;
1952
t_3 = CALL_1ARGS( t_4, l_opr );
1953
CHECK_FUNC_RESULT( t_3 )
1954
CALL_2ARGS( t_1, t_2, t_3 );
1955
1956
}
1957
1958
/* else */
1959
else {
1960
1961
/* Error( "required filters ", NamesFilter( imp[notmatch] ), "\nfor ", Ordinal( notmatch ), " argument do not match a declaration of ", NAME_FUNC( opr ) ); */
1962
t_1 = GF_Error;
1963
C_NEW_STRING( t_2, 17, "required filters " );
1964
t_4 = GF_NamesFilter;
1965
CHECK_INT_POS( l_notmatch )
1966
C_ELM_LIST_FPL( t_5, l_imp, l_notmatch )
1967
t_3 = CALL_1ARGS( t_4, t_5 );
1968
CHECK_FUNC_RESULT( t_3 )
1969
C_NEW_STRING( t_4, 5, "\nfor " );
1970
t_6 = GF_Ordinal;
1971
t_5 = CALL_1ARGS( t_6, l_notmatch );
1972
CHECK_FUNC_RESULT( t_5 )
1973
C_NEW_STRING( t_6, 40, " argument do not match a declaration of " );
1974
t_8 = GF_NAME__FUNC;
1975
t_7 = CALL_1ARGS( t_8, l_opr );
1976
CHECK_FUNC_RESULT( t_7 )
1977
CALL_6ARGS( t_1, t_2, t_3, t_4, t_5, t_6, t_7 );
1978
1979
}
1980
/* fi */
1981
1982
}
1983
1984
/* else */
1985
else {
1986
1987
/* for k in [ j + 1 .. LEN_LIST( req ) ] do */
1988
C_SUM_FIA( t_2, l_j, INTOBJ_INT(1) )
1989
CHECK_INT_SMALL( t_2 )
1990
t_4 = GF_LEN__LIST;
1991
t_3 = CALL_1ARGS( t_4, l_req );
1992
CHECK_FUNC_RESULT( t_3 )
1993
CHECK_INT_SMALL( t_3 )
1994
for ( t_1 = t_2;
1995
((Int)t_1) <= ((Int)t_3);
1996
t_1 = (Obj)(((UInt)t_1)+4) ) {
1997
l_k = t_1;
1998
1999
/* reqs := req[k]; */
2000
CHECK_INT_POS( l_k )
2001
C_ELM_LIST_FPL( t_4, l_req, l_k )
2002
l_reqs = t_4;
2003
2004
/* if LEN_LIST( reqs ) = LEN_LIST( imp ) then */
2005
t_6 = GF_LEN__LIST;
2006
t_5 = CALL_1ARGS( t_6, l_reqs );
2007
CHECK_FUNC_RESULT( t_5 )
2008
t_7 = GF_LEN__LIST;
2009
t_6 = CALL_1ARGS( t_7, l_imp );
2010
CHECK_FUNC_RESULT( t_6 )
2011
t_4 = (Obj)(UInt)(EQ( t_5, t_6 ));
2012
if ( t_4 ) {
2013
2014
/* match := true; */
2015
t_4 = True;
2016
l_match = t_4;
2017
2018
/* for i in [ 1 .. LEN_LIST( reqs ) ] do */
2019
t_6 = GF_LEN__LIST;
2020
t_5 = CALL_1ARGS( t_6, l_reqs );
2021
CHECK_FUNC_RESULT( t_5 )
2022
CHECK_INT_SMALL( t_5 )
2023
for ( t_4 = INTOBJ_INT(1);
2024
((Int)t_4) <= ((Int)t_5);
2025
t_4 = (Obj)(((UInt)t_4)+4) ) {
2026
l_i = t_4;
2027
2028
/* if not IS_SUBSET_FLAGS( imp[i], reqs[i] ) then */
2029
t_9 = GF_IS__SUBSET__FLAGS;
2030
C_ELM_LIST_FPL( t_10, l_imp, l_i )
2031
C_ELM_LIST_FPL( t_11, l_reqs, l_i )
2032
t_8 = CALL_2ARGS( t_9, t_10, t_11 );
2033
CHECK_FUNC_RESULT( t_8 )
2034
CHECK_BOOL( t_8 )
2035
t_7 = (Obj)(UInt)(t_8 != False);
2036
t_6 = (Obj)(UInt)( ! ((Int)t_7) );
2037
if ( t_6 ) {
2038
2039
/* match := false; */
2040
t_6 = False;
2041
l_match = t_6;
2042
2043
/* break; */
2044
break;
2045
2046
}
2047
/* fi */
2048
2049
}
2050
/* od */
2051
2052
/* if match then */
2053
t_4 = (Obj)(UInt)(l_match != False);
2054
if ( t_4 ) {
2055
2056
/* INFO_DEBUG( 1, "method installed for ", NAME_FUNC( opr ), " matches more than one declaration" ); */
2057
t_4 = GF_INFO__DEBUG;
2058
C_NEW_STRING( t_5, 21, "method installed for " );
2059
t_7 = GF_NAME__FUNC;
2060
t_6 = CALL_1ARGS( t_7, l_opr );
2061
CHECK_FUNC_RESULT( t_6 )
2062
C_NEW_STRING( t_7, 34, " matches more than one declaration" );
2063
CALL_4ARGS( t_4, INTOBJ_INT(1), t_5, t_6, t_7 );
2064
2065
}
2066
/* fi */
2067
2068
}
2069
/* fi */
2070
2071
}
2072
/* od */
2073
2074
}
2075
/* fi */
2076
2077
}
2078
/* fi */
2079
2080
/* INSTALL_METHOD_FLAGS( opr, info, rel, flags, rank, method ); */
2081
t_1 = GF_INSTALL__METHOD__FLAGS;
2082
CHECK_BOUND( l_rank, "rank" )
2083
CALL_6ARGS( t_1, l_opr, l_info, l_rel, l_flags, l_rank, l_method );
2084
2085
/* return; */
2086
RES_BRK_CURR_STAT();
2087
SWITCH_TO_OLD_FRAME(oldFrame);
2088
return 0;
2089
2090
/* return; */
2091
RES_BRK_CURR_STAT();
2092
SWITCH_TO_OLD_FRAME(oldFrame);
2093
return 0;
2094
}
2095
2096
/* handler for function 8 */
2097
static Obj HdlrFunc8 (
2098
Obj self,
2099
Obj a_obj )
2100
{
2101
Obj l_found = 0;
2102
Obj l_prop = 0;
2103
Obj t_1 = 0;
2104
Obj t_2 = 0;
2105
Obj t_3 = 0;
2106
Obj t_4 = 0;
2107
Obj t_5 = 0;
2108
Obj t_6 = 0;
2109
Obj t_7 = 0;
2110
Obj t_8 = 0;
2111
Obj t_9 = 0;
2112
Obj t_10 = 0;
2113
Obj t_11 = 0;
2114
Bag oldFrame;
2115
OLD_BRK_CURR_STAT
2116
2117
/* allocate new stack frame */
2118
SWITCH_TO_NEW_FRAME(self,0,0,oldFrame);
2119
REM_BRK_CURR_STAT();
2120
SET_BRK_CURR_STAT(0);
2121
2122
/* found := false; */
2123
t_1 = False;
2124
l_found = t_1;
2125
2126
/* for prop in props do */
2127
t_4 = OBJ_LVAR_1UP( 2 );
2128
CHECK_BOUND( t_4, "props" )
2129
if ( IS_SMALL_LIST(t_4) ) {
2130
t_3 = (Obj)(UInt)1;
2131
t_1 = INTOBJ_INT(1);
2132
}
2133
else {
2134
t_3 = (Obj)(UInt)0;
2135
t_1 = CALL_1ARGS( GF_ITERATOR, t_4 );
2136
}
2137
while ( 1 ) {
2138
if ( t_3 ) {
2139
if ( LEN_LIST(t_4) < INT_INTOBJ(t_1) ) break;
2140
t_2 = ELMV0_LIST( t_4, INT_INTOBJ(t_1) );
2141
t_1 = (Obj)(((UInt)t_1)+4);
2142
if ( t_2 == 0 ) continue;
2143
}
2144
else {
2145
if ( CALL_1ARGS( GF_IS_DONE_ITER, t_1 ) != False ) break;
2146
t_2 = CALL_1ARGS( GF_NEXT_ITER, t_1 );
2147
}
2148
l_prop = t_2;
2149
2150
/* if not Tester( prop )( obj ) then */
2151
t_9 = GF_Tester;
2152
t_8 = CALL_1ARGS( t_9, l_prop );
2153
CHECK_FUNC_RESULT( t_8 )
2154
CHECK_FUNC( t_8 )
2155
t_7 = CALL_1ARGS( t_8, a_obj );
2156
CHECK_FUNC_RESULT( t_7 )
2157
CHECK_BOOL( t_7 )
2158
t_6 = (Obj)(UInt)(t_7 != False);
2159
t_5 = (Obj)(UInt)( ! ((Int)t_6) );
2160
if ( t_5 ) {
2161
2162
/* found := true; */
2163
t_5 = True;
2164
l_found = t_5;
2165
2166
/* if not (prop( obj ) and Tester( prop )( obj )) then */
2167
CHECK_FUNC( l_prop )
2168
t_8 = CALL_1ARGS( l_prop, a_obj );
2169
CHECK_FUNC_RESULT( t_8 )
2170
CHECK_BOOL( t_8 )
2171
t_7 = (Obj)(UInt)(t_8 != False);
2172
t_6 = t_7;
2173
if ( t_6 ) {
2174
t_11 = GF_Tester;
2175
t_10 = CALL_1ARGS( t_11, l_prop );
2176
CHECK_FUNC_RESULT( t_10 )
2177
CHECK_FUNC( t_10 )
2178
t_9 = CALL_1ARGS( t_10, a_obj );
2179
CHECK_FUNC_RESULT( t_9 )
2180
CHECK_BOOL( t_9 )
2181
t_8 = (Obj)(UInt)(t_9 != False);
2182
t_6 = t_8;
2183
}
2184
t_5 = (Obj)(UInt)( ! ((Int)t_6) );
2185
if ( t_5 ) {
2186
2187
/* return TRY_NEXT_METHOD; */
2188
t_5 = GC_TRY__NEXT__METHOD;
2189
CHECK_BOUND( t_5, "TRY_NEXT_METHOD" )
2190
RES_BRK_CURR_STAT();
2191
SWITCH_TO_OLD_FRAME(oldFrame);
2192
return t_5;
2193
2194
}
2195
/* fi */
2196
2197
}
2198
/* fi */
2199
2200
}
2201
/* od */
2202
2203
/* if found then */
2204
t_1 = (Obj)(UInt)(l_found != False);
2205
if ( t_1 ) {
2206
2207
/* return getter( obj ); */
2208
t_2 = OBJ_LVAR_1UP( 1 );
2209
CHECK_BOUND( t_2, "getter" )
2210
CHECK_FUNC( t_2 )
2211
t_1 = CALL_1ARGS( t_2, a_obj );
2212
CHECK_FUNC_RESULT( t_1 )
2213
RES_BRK_CURR_STAT();
2214
SWITCH_TO_OLD_FRAME(oldFrame);
2215
return t_1;
2216
2217
}
2218
2219
/* else */
2220
else {
2221
2222
/* return TRY_NEXT_METHOD; */
2223
t_1 = GC_TRY__NEXT__METHOD;
2224
CHECK_BOUND( t_1, "TRY_NEXT_METHOD" )
2225
RES_BRK_CURR_STAT();
2226
SWITCH_TO_OLD_FRAME(oldFrame);
2227
return t_1;
2228
2229
}
2230
/* fi */
2231
2232
/* return; */
2233
RES_BRK_CURR_STAT();
2234
SWITCH_TO_OLD_FRAME(oldFrame);
2235
return 0;
2236
2237
/* return; */
2238
RES_BRK_CURR_STAT();
2239
SWITCH_TO_OLD_FRAME(oldFrame);
2240
return 0;
2241
}
2242
2243
/* handler for function 7 */
2244
static Obj HdlrFunc7 (
2245
Obj self,
2246
Obj a_name,
2247
Obj a_filter,
2248
Obj a_getter,
2249
Obj a_setter,
2250
Obj a_tester,
2251
Obj a_mutflag )
2252
{
2253
Obj l_flags = 0;
2254
Obj l_rank = 0;
2255
Obj l_cats = 0;
2256
Obj l_i = 0;
2257
Obj t_1 = 0;
2258
Obj t_2 = 0;
2259
Obj t_3 = 0;
2260
Obj t_4 = 0;
2261
Obj t_5 = 0;
2262
Obj t_6 = 0;
2263
Obj t_7 = 0;
2264
Bag oldFrame;
2265
OLD_BRK_CURR_STAT
2266
2267
/* allocate new stack frame */
2268
SWITCH_TO_NEW_FRAME(self,2,0,oldFrame);
2269
ASS_LVAR( 1, a_getter );
2270
REM_BRK_CURR_STAT();
2271
SET_BRK_CURR_STAT(0);
2272
2273
/* if not IS_IDENTICAL_OBJ( filter, IS_OBJECT ) then */
2274
t_4 = GF_IS__IDENTICAL__OBJ;
2275
t_5 = GC_IS__OBJECT;
2276
CHECK_BOUND( t_5, "IS_OBJECT" )
2277
t_3 = CALL_2ARGS( t_4, a_filter, t_5 );
2278
CHECK_FUNC_RESULT( t_3 )
2279
CHECK_BOOL( t_3 )
2280
t_2 = (Obj)(UInt)(t_3 != False);
2281
t_1 = (Obj)(UInt)( ! ((Int)t_2) );
2282
if ( t_1 ) {
2283
2284
/* flags := FLAGS_FILTER( filter ); */
2285
t_2 = GF_FLAGS__FILTER;
2286
t_1 = CALL_1ARGS( t_2, a_filter );
2287
CHECK_FUNC_RESULT( t_1 )
2288
l_flags = t_1;
2289
2290
/* rank := 0; */
2291
l_rank = INTOBJ_INT(0);
2292
2293
/* cats := IS_OBJECT; */
2294
t_1 = GC_IS__OBJECT;
2295
CHECK_BOUND( t_1, "IS_OBJECT" )
2296
l_cats = t_1;
2297
2298
/* props := [ ]; */
2299
t_1 = NEW_PLIST( T_PLIST, 0 );
2300
SET_LEN_PLIST( t_1, 0 );
2301
ASS_LVAR( 2, t_1 );
2302
2303
/* for i in [ 1 .. LEN_FLAGS( flags ) ] do */
2304
t_3 = GF_LEN__FLAGS;
2305
t_2 = CALL_1ARGS( t_3, l_flags );
2306
CHECK_FUNC_RESULT( t_2 )
2307
CHECK_INT_SMALL( t_2 )
2308
for ( t_1 = INTOBJ_INT(1);
2309
((Int)t_1) <= ((Int)t_2);
2310
t_1 = (Obj)(((UInt)t_1)+4) ) {
2311
l_i = t_1;
2312
2313
/* if ELM_FLAGS( flags, i ) then */
2314
t_5 = GF_ELM__FLAGS;
2315
t_4 = CALL_2ARGS( t_5, l_flags, l_i );
2316
CHECK_FUNC_RESULT( t_4 )
2317
CHECK_BOOL( t_4 )
2318
t_3 = (Obj)(UInt)(t_4 != False);
2319
if ( t_3 ) {
2320
2321
/* if i in CATS_AND_REPS then */
2322
t_4 = GC_CATS__AND__REPS;
2323
CHECK_BOUND( t_4, "CATS_AND_REPS" )
2324
t_3 = (Obj)(UInt)(IN( l_i, t_4 ));
2325
if ( t_3 ) {
2326
2327
/* cats := cats and FILTERS[i]; */
2328
if ( l_cats == False ) {
2329
t_3 = l_cats;
2330
}
2331
else if ( l_cats == True ) {
2332
t_5 = GC_FILTERS;
2333
CHECK_BOUND( t_5, "FILTERS" )
2334
C_ELM_LIST_FPL( t_4, t_5, l_i )
2335
CHECK_BOOL( t_4 )
2336
t_3 = t_4;
2337
}
2338
else {
2339
CHECK_FUNC( l_cats )
2340
t_6 = GC_FILTERS;
2341
CHECK_BOUND( t_6, "FILTERS" )
2342
C_ELM_LIST_FPL( t_5, t_6, l_i )
2343
CHECK_FUNC( t_5 )
2344
t_3 = NewAndFilter( l_cats, t_5 );
2345
}
2346
l_cats = t_3;
2347
2348
/* rank := rank - RankFilter( FILTERS[i] ); */
2349
t_5 = GF_RankFilter;
2350
t_7 = GC_FILTERS;
2351
CHECK_BOUND( t_7, "FILTERS" )
2352
C_ELM_LIST_FPL( t_6, t_7, l_i )
2353
t_4 = CALL_1ARGS( t_5, t_6 );
2354
CHECK_FUNC_RESULT( t_4 )
2355
C_DIFF_FIA( t_3, l_rank, t_4 )
2356
l_rank = t_3;
2357
2358
}
2359
2360
/* elif i in NUMBERS_PROPERTY_GETTERS then */
2361
else {
2362
t_4 = GC_NUMBERS__PROPERTY__GETTERS;
2363
CHECK_BOUND( t_4, "NUMBERS_PROPERTY_GETTERS" )
2364
t_3 = (Obj)(UInt)(IN( l_i, t_4 ));
2365
if ( t_3 ) {
2366
2367
/* ADD_LIST( props, FILTERS[i] ); */
2368
t_3 = GF_ADD__LIST;
2369
t_4 = OBJ_LVAR( 2 );
2370
CHECK_BOUND( t_4, "props" )
2371
t_6 = GC_FILTERS;
2372
CHECK_BOUND( t_6, "FILTERS" )
2373
C_ELM_LIST_FPL( t_5, t_6, l_i )
2374
CALL_2ARGS( t_3, t_4, t_5 );
2375
2376
}
2377
}
2378
/* fi */
2379
2380
}
2381
/* fi */
2382
2383
}
2384
/* od */
2385
2386
/* if 0 < LEN_LIST( props ) then */
2387
t_3 = GF_LEN__LIST;
2388
t_4 = OBJ_LVAR( 2 );
2389
CHECK_BOUND( t_4, "props" )
2390
t_2 = CALL_1ARGS( t_3, t_4 );
2391
CHECK_FUNC_RESULT( t_2 )
2392
t_1 = (Obj)(UInt)(LT( INTOBJ_INT(0), t_2 ));
2393
if ( t_1 ) {
2394
2395
/* InstallOtherMethod( getter, "default method requiring categories and checking properties", true, [ cats ], rank, function ( obj )
2396
local found, prop;
2397
found := false;
2398
for prop in props do
2399
if not Tester( prop )( obj ) then
2400
found := true;
2401
if not (prop( obj ) and Tester( prop )( obj )) then
2402
return TRY_NEXT_METHOD;
2403
fi;
2404
fi;
2405
od;
2406
if found then
2407
return getter( obj );
2408
else
2409
return TRY_NEXT_METHOD;
2410
fi;
2411
return;
2412
end ); */
2413
t_1 = GF_InstallOtherMethod;
2414
t_2 = OBJ_LVAR( 1 );
2415
CHECK_BOUND( t_2, "getter" )
2416
C_NEW_STRING( t_3, 59, "default method requiring categories and checking properties" );
2417
t_4 = True;
2418
t_5 = NEW_PLIST( T_PLIST, 1 );
2419
SET_LEN_PLIST( t_5, 1 );
2420
SET_ELM_PLIST( t_5, 1, l_cats );
2421
CHANGED_BAG( t_5 );
2422
t_6 = NewFunction( NameFunc[8], NargFunc[8], NamsFunc[8], HdlrFunc8 );
2423
ENVI_FUNC( t_6 ) = TLS(CurrLVars);
2424
t_7 = NewBag( T_BODY, NUMBER_HEADER_ITEMS_BODY*sizeof(Obj) );
2425
STARTLINE_BODY(t_7) = INTOBJ_INT(577);
2426
ENDLINE_BODY(t_7) = INTOBJ_INT(595);
2427
FILENAME_BODY(t_7) = FileName;
2428
BODY_FUNC(t_6) = t_7;
2429
CHANGED_BAG( TLS(CurrLVars) );
2430
CALL_6ARGS( t_1, t_2, t_3, t_4, t_5, l_rank, t_6 );
2431
2432
}
2433
/* fi */
2434
2435
}
2436
/* fi */
2437
2438
/* return; */
2439
RES_BRK_CURR_STAT();
2440
SWITCH_TO_OLD_FRAME(oldFrame);
2441
return 0;
2442
2443
/* return; */
2444
RES_BRK_CURR_STAT();
2445
SWITCH_TO_OLD_FRAME(oldFrame);
2446
return 0;
2447
}
2448
2449
/* handler for function 9 */
2450
static Obj HdlrFunc9 (
2451
Obj self,
2452
Obj a_name,
2453
Obj a_filter,
2454
Obj a_getter,
2455
Obj a_setter,
2456
Obj a_tester,
2457
Obj a_mutflag )
2458
{
2459
Obj t_1 = 0;
2460
Obj t_2 = 0;
2461
Obj t_3 = 0;
2462
Obj t_4 = 0;
2463
Obj t_5 = 0;
2464
Bag oldFrame;
2465
OLD_BRK_CURR_STAT
2466
2467
/* allocate new stack frame */
2468
SWITCH_TO_NEW_FRAME(self,0,0,oldFrame);
2469
REM_BRK_CURR_STAT();
2470
SET_BRK_CURR_STAT(0);
2471
2472
/* InstallOtherMethod( setter, "default method, does nothing", true, [ IS_OBJECT, IS_OBJECT ], 0, DO_NOTHING_SETTER ); */
2473
t_1 = GF_InstallOtherMethod;
2474
C_NEW_STRING( t_2, 28, "default method, does nothing" );
2475
t_3 = True;
2476
t_4 = NEW_PLIST( T_PLIST, 2 );
2477
SET_LEN_PLIST( t_4, 2 );
2478
t_5 = GC_IS__OBJECT;
2479
CHECK_BOUND( t_5, "IS_OBJECT" )
2480
SET_ELM_PLIST( t_4, 1, t_5 );
2481
CHANGED_BAG( t_4 );
2482
t_5 = GC_IS__OBJECT;
2483
CHECK_BOUND( t_5, "IS_OBJECT" )
2484
SET_ELM_PLIST( t_4, 2, t_5 );
2485
CHANGED_BAG( t_4 );
2486
t_5 = GC_DO__NOTHING__SETTER;
2487
CHECK_BOUND( t_5, "DO_NOTHING_SETTER" )
2488
CALL_6ARGS( t_1, a_setter, t_2, t_3, t_4, INTOBJ_INT(0), t_5 );
2489
2490
/* return; */
2491
RES_BRK_CURR_STAT();
2492
SWITCH_TO_OLD_FRAME(oldFrame);
2493
return 0;
2494
2495
/* return; */
2496
RES_BRK_CURR_STAT();
2497
SWITCH_TO_OLD_FRAME(oldFrame);
2498
return 0;
2499
}
2500
2501
/* handler for function 11 */
2502
static Obj HdlrFunc11 (
2503
Obj self,
2504
Obj a_key )
2505
{
2506
Obj t_1 = 0;
2507
Obj t_2 = 0;
2508
Obj t_3 = 0;
2509
Obj t_4 = 0;
2510
Bag oldFrame;
2511
OLD_BRK_CURR_STAT
2512
2513
/* allocate new stack frame */
2514
SWITCH_TO_NEW_FRAME(self,0,0,oldFrame);
2515
REM_BRK_CURR_STAT();
2516
SET_BRK_CURR_STAT(0);
2517
2518
/* if not IsPrimeInt( key ) then */
2519
t_4 = GF_IsPrimeInt;
2520
t_3 = CALL_1ARGS( t_4, a_key );
2521
CHECK_FUNC_RESULT( t_3 )
2522
CHECK_BOOL( t_3 )
2523
t_2 = (Obj)(UInt)(t_3 != False);
2524
t_1 = (Obj)(UInt)( ! ((Int)t_2) );
2525
if ( t_1 ) {
2526
2527
/* Error( name, ": <p> must be a prime" ); */
2528
t_1 = GF_Error;
2529
t_2 = OBJ_LVAR_1UP( 1 );
2530
CHECK_BOUND( t_2, "name" )
2531
C_NEW_STRING( t_3, 21, ": <p> must be a prime" );
2532
CALL_2ARGS( t_1, t_2, t_3 );
2533
2534
}
2535
/* fi */
2536
2537
/* return; */
2538
RES_BRK_CURR_STAT();
2539
SWITCH_TO_OLD_FRAME(oldFrame);
2540
return 0;
2541
2542
/* return; */
2543
RES_BRK_CURR_STAT();
2544
SWITCH_TO_OLD_FRAME(oldFrame);
2545
return 0;
2546
}
2547
2548
/* handler for function 12 */
2549
static Obj HdlrFunc12 (
2550
Obj self,
2551
Obj a_D )
2552
{
2553
Obj t_1 = 0;
2554
Bag oldFrame;
2555
OLD_BRK_CURR_STAT
2556
2557
/* allocate new stack frame */
2558
SWITCH_TO_NEW_FRAME(self,0,0,oldFrame);
2559
REM_BRK_CURR_STAT();
2560
SET_BRK_CURR_STAT(0);
2561
2562
/* return [ ]; */
2563
t_1 = NEW_PLIST( T_PLIST, 0 );
2564
SET_LEN_PLIST( t_1, 0 );
2565
RES_BRK_CURR_STAT();
2566
SWITCH_TO_OLD_FRAME(oldFrame);
2567
return t_1;
2568
2569
/* return; */
2570
RES_BRK_CURR_STAT();
2571
SWITCH_TO_OLD_FRAME(oldFrame);
2572
return 0;
2573
}
2574
2575
/* handler for function 13 */
2576
static Obj HdlrFunc13 (
2577
Obj self,
2578
Obj a_D,
2579
Obj a_key )
2580
{
2581
Obj l_known = 0;
2582
Obj l_i = 0;
2583
Obj l_erg = 0;
2584
Obj t_1 = 0;
2585
Obj t_2 = 0;
2586
Obj t_3 = 0;
2587
Obj t_4 = 0;
2588
Obj t_5 = 0;
2589
Bag oldFrame;
2590
OLD_BRK_CURR_STAT
2591
2592
/* allocate new stack frame */
2593
SWITCH_TO_NEW_FRAME(self,0,0,oldFrame);
2594
REM_BRK_CURR_STAT();
2595
SET_BRK_CURR_STAT(0);
2596
2597
/* keytest( key ); */
2598
t_1 = OBJ_LVAR_1UP( 2 );
2599
CHECK_BOUND( t_1, "keytest" )
2600
CHECK_FUNC( t_1 )
2601
CALL_1ARGS( t_1, a_key );
2602
2603
/* known := attr( D ); */
2604
t_2 = OBJ_LVAR_1UP( 4 );
2605
CHECK_BOUND( t_2, "attr" )
2606
CHECK_FUNC( t_2 )
2607
t_1 = CALL_1ARGS( t_2, a_D );
2608
CHECK_FUNC_RESULT( t_1 )
2609
l_known = t_1;
2610
2611
/* i := 1; */
2612
l_i = INTOBJ_INT(1);
2613
2614
/* while i < LEN_LIST( known ) and known[i] < key od */
2615
while ( 1 ) {
2616
t_4 = GF_LEN__LIST;
2617
t_3 = CALL_1ARGS( t_4, l_known );
2618
CHECK_FUNC_RESULT( t_3 )
2619
t_2 = (Obj)(UInt)(LT( l_i, t_3 ));
2620
t_1 = t_2;
2621
if ( t_1 ) {
2622
CHECK_INT_POS( l_i )
2623
C_ELM_LIST_FPL( t_4, l_known, l_i )
2624
t_3 = (Obj)(UInt)(LT( t_4, a_key ));
2625
t_1 = t_3;
2626
}
2627
if ( ! t_1 ) break;
2628
2629
/* i := i + 2; */
2630
C_SUM_FIA( t_1, l_i, INTOBJ_INT(2) )
2631
l_i = t_1;
2632
2633
}
2634
/* od */
2635
2636
/* if LEN_LIST( known ) < i or known[i] <> key then */
2637
t_4 = GF_LEN__LIST;
2638
t_3 = CALL_1ARGS( t_4, l_known );
2639
CHECK_FUNC_RESULT( t_3 )
2640
t_2 = (Obj)(UInt)(LT( t_3, l_i ));
2641
t_1 = t_2;
2642
if ( ! t_1 ) {
2643
CHECK_INT_POS( l_i )
2644
C_ELM_LIST_FPL( t_4, l_known, l_i )
2645
t_3 = (Obj)(UInt)( ! EQ( t_4, a_key ));
2646
t_1 = t_3;
2647
}
2648
if ( t_1 ) {
2649
2650
/* erg := oper( D, key ); */
2651
t_2 = OBJ_LVAR_1UP( 3 );
2652
CHECK_BOUND( t_2, "oper" )
2653
CHECK_FUNC( t_2 )
2654
t_1 = CALL_2ARGS( t_2, a_D, a_key );
2655
CHECK_FUNC_RESULT( t_1 )
2656
l_erg = t_1;
2657
2658
/* known{[ i + 2 .. LEN_LIST( known ) + 2 ]} := known{[ i .. LEN_LIST( known ) ]}; */
2659
C_SUM_FIA( t_2, l_i, INTOBJ_INT(2) )
2660
t_5 = GF_LEN__LIST;
2661
t_4 = CALL_1ARGS( t_5, l_known );
2662
CHECK_FUNC_RESULT( t_4 )
2663
C_SUM_FIA( t_3, t_4, INTOBJ_INT(2) )
2664
t_1 = Range2Check( t_2, t_3 );
2665
t_5 = GF_LEN__LIST;
2666
t_4 = CALL_1ARGS( t_5, l_known );
2667
CHECK_FUNC_RESULT( t_4 )
2668
t_3 = Range2Check( l_i, t_4 );
2669
t_2 = ElmsListCheck( l_known, t_3 );
2670
AsssListCheck( l_known, t_1, t_2 );
2671
2672
/* known[i] := key; */
2673
CHECK_INT_POS( l_i )
2674
C_ASS_LIST_FPL( l_known, l_i, a_key )
2675
2676
/* known[i + 1] := erg; */
2677
C_SUM_FIA( t_1, l_i, INTOBJ_INT(1) )
2678
CHECK_INT_POS( t_1 )
2679
C_ASS_LIST_FPL( l_known, t_1, l_erg )
2680
2681
}
2682
/* fi */
2683
2684
/* return known[i + 1]; */
2685
C_SUM_FIA( t_2, l_i, INTOBJ_INT(1) )
2686
CHECK_INT_POS( t_2 )
2687
C_ELM_LIST_FPL( t_1, l_known, t_2 )
2688
RES_BRK_CURR_STAT();
2689
SWITCH_TO_OLD_FRAME(oldFrame);
2690
return t_1;
2691
2692
/* return; */
2693
RES_BRK_CURR_STAT();
2694
SWITCH_TO_OLD_FRAME(oldFrame);
2695
return 0;
2696
}
2697
2698
/* handler for function 10 */
2699
static Obj HdlrFunc10 (
2700
Obj self,
2701
Obj a_name,
2702
Obj a_domreq,
2703
Obj a_keyreq,
2704
Obj a_keytest )
2705
{
2706
Obj l_str = 0;
2707
Obj t_1 = 0;
2708
Obj t_2 = 0;
2709
Obj t_3 = 0;
2710
Obj t_4 = 0;
2711
Obj t_5 = 0;
2712
Obj t_6 = 0;
2713
Obj t_7 = 0;
2714
Bag oldFrame;
2715
OLD_BRK_CURR_STAT
2716
2717
/* allocate new stack frame */
2718
SWITCH_TO_NEW_FRAME(self,4,0,oldFrame);
2719
ASS_LVAR( 1, a_name );
2720
ASS_LVAR( 2, a_keytest );
2721
REM_BRK_CURR_STAT();
2722
SET_BRK_CURR_STAT(0);
2723
2724
/* if keytest = "prime" then */
2725
t_2 = OBJ_LVAR( 2 );
2726
CHECK_BOUND( t_2, "keytest" )
2727
C_NEW_STRING( t_3, 5, "prime" );
2728
t_1 = (Obj)(UInt)(EQ( t_2, t_3 ));
2729
if ( t_1 ) {
2730
2731
/* keytest := function ( key )
2732
if not IsPrimeInt( key ) then
2733
Error( name, ": <p> must be a prime" );
2734
fi;
2735
return;
2736
end; */
2737
t_1 = NewFunction( NameFunc[11], NargFunc[11], NamsFunc[11], HdlrFunc11 );
2738
ENVI_FUNC( t_1 ) = TLS(CurrLVars);
2739
t_2 = NewBag( T_BODY, NUMBER_HEADER_ITEMS_BODY*sizeof(Obj) );
2740
STARTLINE_BODY(t_2) = INTOBJ_INT(732);
2741
ENDLINE_BODY(t_2) = INTOBJ_INT(736);
2742
FILENAME_BODY(t_2) = FileName;
2743
BODY_FUNC(t_1) = t_2;
2744
CHANGED_BAG( TLS(CurrLVars) );
2745
ASS_LVAR( 2, t_1 );
2746
2747
}
2748
/* fi */
2749
2750
/* str := SHALLOW_COPY_OBJ( name ); */
2751
t_2 = GF_SHALLOW__COPY__OBJ;
2752
t_3 = OBJ_LVAR( 1 );
2753
CHECK_BOUND( t_3, "name" )
2754
t_1 = CALL_1ARGS( t_2, t_3 );
2755
CHECK_FUNC_RESULT( t_1 )
2756
l_str = t_1;
2757
2758
/* APPEND_LIST_INTR( str, "Op" ); */
2759
t_1 = GF_APPEND__LIST__INTR;
2760
C_NEW_STRING( t_2, 2, "Op" );
2761
CALL_2ARGS( t_1, l_str, t_2 );
2762
2763
/* DeclareOperation( str, [ domreq, keyreq ] ); */
2764
t_1 = GF_DeclareOperation;
2765
t_2 = NEW_PLIST( T_PLIST, 2 );
2766
SET_LEN_PLIST( t_2, 2 );
2767
SET_ELM_PLIST( t_2, 1, a_domreq );
2768
CHANGED_BAG( t_2 );
2769
SET_ELM_PLIST( t_2, 2, a_keyreq );
2770
CHANGED_BAG( t_2 );
2771
CALL_2ARGS( t_1, l_str, t_2 );
2772
2773
/* oper := VALUE_GLOBAL( str ); */
2774
t_2 = GF_VALUE__GLOBAL;
2775
t_1 = CALL_1ARGS( t_2, l_str );
2776
CHECK_FUNC_RESULT( t_1 )
2777
ASS_LVAR( 3, t_1 );
2778
2779
/* str := "Computed"; */
2780
C_NEW_STRING( t_1, 8, "Computed" );
2781
l_str = t_1;
2782
2783
/* APPEND_LIST_INTR( str, name ); */
2784
t_1 = GF_APPEND__LIST__INTR;
2785
t_2 = OBJ_LVAR( 1 );
2786
CHECK_BOUND( t_2, "name" )
2787
CALL_2ARGS( t_1, l_str, t_2 );
2788
2789
/* APPEND_LIST_INTR( str, "s" ); */
2790
t_1 = GF_APPEND__LIST__INTR;
2791
C_NEW_STRING( t_2, 1, "s" );
2792
CALL_2ARGS( t_1, l_str, t_2 );
2793
2794
/* DeclareAttribute( str, domreq, "mutable" ); */
2795
t_1 = GF_DeclareAttribute;
2796
C_NEW_STRING( t_2, 7, "mutable" );
2797
CALL_3ARGS( t_1, l_str, a_domreq, t_2 );
2798
2799
/* attr := VALUE_GLOBAL( str ); */
2800
t_2 = GF_VALUE__GLOBAL;
2801
t_1 = CALL_1ARGS( t_2, l_str );
2802
CHECK_FUNC_RESULT( t_1 )
2803
ASS_LVAR( 4, t_1 );
2804
2805
/* InstallMethod( attr, "default method", true, [ domreq ], 0, function ( D )
2806
return [ ];
2807
end ); */
2808
t_1 = GF_InstallMethod;
2809
t_2 = OBJ_LVAR( 4 );
2810
CHECK_BOUND( t_2, "attr" )
2811
C_NEW_STRING( t_3, 14, "default method" );
2812
t_4 = True;
2813
t_5 = NEW_PLIST( T_PLIST, 1 );
2814
SET_LEN_PLIST( t_5, 1 );
2815
SET_ELM_PLIST( t_5, 1, a_domreq );
2816
CHANGED_BAG( t_5 );
2817
t_6 = NewFunction( NameFunc[12], NargFunc[12], NamsFunc[12], HdlrFunc12 );
2818
ENVI_FUNC( t_6 ) = TLS(CurrLVars);
2819
t_7 = NewBag( T_BODY, NUMBER_HEADER_ITEMS_BODY*sizeof(Obj) );
2820
STARTLINE_BODY(t_7) = INTOBJ_INT(753);
2821
ENDLINE_BODY(t_7) = INTOBJ_INT(753);
2822
FILENAME_BODY(t_7) = FileName;
2823
BODY_FUNC(t_6) = t_7;
2824
CHANGED_BAG( TLS(CurrLVars) );
2825
CALL_6ARGS( t_1, t_2, t_3, t_4, t_5, INTOBJ_INT(0), t_6 );
2826
2827
/* DeclareOperation( name, [ domreq, keyreq ] ); */
2828
t_1 = GF_DeclareOperation;
2829
t_2 = OBJ_LVAR( 1 );
2830
CHECK_BOUND( t_2, "name" )
2831
t_3 = NEW_PLIST( T_PLIST, 2 );
2832
SET_LEN_PLIST( t_3, 2 );
2833
SET_ELM_PLIST( t_3, 1, a_domreq );
2834
CHANGED_BAG( t_3 );
2835
SET_ELM_PLIST( t_3, 2, a_keyreq );
2836
CHANGED_BAG( t_3 );
2837
CALL_2ARGS( t_1, t_2, t_3 );
2838
2839
/* ADD_LIST( WRAPPER_OPERATIONS, VALUE_GLOBAL( name ) ); */
2840
t_1 = GF_ADD__LIST;
2841
t_2 = GC_WRAPPER__OPERATIONS;
2842
CHECK_BOUND( t_2, "WRAPPER_OPERATIONS" )
2843
t_4 = GF_VALUE__GLOBAL;
2844
t_5 = OBJ_LVAR( 1 );
2845
CHECK_BOUND( t_5, "name" )
2846
t_3 = CALL_1ARGS( t_4, t_5 );
2847
CHECK_FUNC_RESULT( t_3 )
2848
CALL_2ARGS( t_1, t_2, t_3 );
2849
2850
/* InstallOtherMethod( VALUE_GLOBAL( name ), "default method", true, [ domreq, keyreq ], 0, function ( D, key )
2851
local known, i, erg;
2852
keytest( key );
2853
known := attr( D );
2854
i := 1;
2855
while i < LEN_LIST( known ) and known[i] < key do
2856
i := i + 2;
2857
od;
2858
if LEN_LIST( known ) < i or known[i] <> key then
2859
erg := oper( D, key );
2860
known{[ i + 2 .. LEN_LIST( known ) + 2 ]} := known{[ i .. LEN_LIST( known ) ]};
2861
known[i] := key;
2862
known[i + 1] := erg;
2863
fi;
2864
return known[i + 1];
2865
end ); */
2866
t_1 = GF_InstallOtherMethod;
2867
t_3 = GF_VALUE__GLOBAL;
2868
t_4 = OBJ_LVAR( 1 );
2869
CHECK_BOUND( t_4, "name" )
2870
t_2 = CALL_1ARGS( t_3, t_4 );
2871
CHECK_FUNC_RESULT( t_2 )
2872
C_NEW_STRING( t_3, 14, "default method" );
2873
t_4 = True;
2874
t_5 = NEW_PLIST( T_PLIST, 2 );
2875
SET_LEN_PLIST( t_5, 2 );
2876
SET_ELM_PLIST( t_5, 1, a_domreq );
2877
CHANGED_BAG( t_5 );
2878
SET_ELM_PLIST( t_5, 2, a_keyreq );
2879
CHANGED_BAG( t_5 );
2880
t_6 = NewFunction( NameFunc[13], NargFunc[13], NamsFunc[13], HdlrFunc13 );
2881
ENVI_FUNC( t_6 ) = TLS(CurrLVars);
2882
t_7 = NewBag( T_BODY, NUMBER_HEADER_ITEMS_BODY*sizeof(Obj) );
2883
STARTLINE_BODY(t_7) = INTOBJ_INT(766);
2884
ENDLINE_BODY(t_7) = INTOBJ_INT(787);
2885
FILENAME_BODY(t_7) = FileName;
2886
BODY_FUNC(t_6) = t_7;
2887
CHANGED_BAG( TLS(CurrLVars) );
2888
CALL_6ARGS( t_1, t_2, t_3, t_4, t_5, INTOBJ_INT(0), t_6 );
2889
2890
/* return; */
2891
RES_BRK_CURR_STAT();
2892
SWITCH_TO_OLD_FRAME(oldFrame);
2893
return 0;
2894
2895
/* return; */
2896
RES_BRK_CURR_STAT();
2897
SWITCH_TO_OLD_FRAME(oldFrame);
2898
return 0;
2899
}
2900
2901
/* handler for function 15 */
2902
static Obj HdlrFunc15 (
2903
Obj self,
2904
Obj a_arg )
2905
{
2906
Obj t_1 = 0;
2907
Obj t_2 = 0;
2908
Obj t_3 = 0;
2909
Obj t_4 = 0;
2910
Obj t_5 = 0;
2911
Obj t_6 = 0;
2912
Obj t_7 = 0;
2913
Obj t_8 = 0;
2914
Obj t_9 = 0;
2915
Obj t_10 = 0;
2916
Obj t_11 = 0;
2917
Obj t_12 = 0;
2918
Obj t_13 = 0;
2919
Obj t_14 = 0;
2920
Obj t_15 = 0;
2921
Obj t_16 = 0;
2922
Obj t_17 = 0;
2923
Obj t_18 = 0;
2924
Bag oldFrame;
2925
OLD_BRK_CURR_STAT
2926
2927
/* allocate new stack frame */
2928
SWITCH_TO_NEW_FRAME(self,0,0,oldFrame);
2929
REM_BRK_CURR_STAT();
2930
SET_BRK_CURR_STAT(0);
2931
2932
/* re := false; */
2933
t_1 = False;
2934
ASS_LVAR_1UP( 4, t_1 );
2935
2936
/* for i in [ 1 .. LEN_LIST( reqs ) ] do */
2937
t_6 = GF_LEN__LIST;
2938
t_7 = OBJ_LVAR_1UP( 2 );
2939
CHECK_BOUND( t_7, "reqs" )
2940
t_5 = CALL_1ARGS( t_6, t_7 );
2941
CHECK_FUNC_RESULT( t_5 )
2942
t_4 = Range2Check( INTOBJ_INT(1), t_5 );
2943
if ( IS_SMALL_LIST(t_4) ) {
2944
t_3 = (Obj)(UInt)1;
2945
t_1 = INTOBJ_INT(1);
2946
}
2947
else {
2948
t_3 = (Obj)(UInt)0;
2949
t_1 = CALL_1ARGS( GF_ITERATOR, t_4 );
2950
}
2951
while ( 1 ) {
2952
if ( t_3 ) {
2953
if ( LEN_LIST(t_4) < INT_INTOBJ(t_1) ) break;
2954
t_2 = ELMV0_LIST( t_4, INT_INTOBJ(t_1) );
2955
t_1 = (Obj)(((UInt)t_1)+4);
2956
if ( t_2 == 0 ) continue;
2957
}
2958
else {
2959
if ( CALL_1ARGS( GF_IS_DONE_ITER, t_1 ) != False ) break;
2960
t_2 = CALL_1ARGS( GF_NEXT_ITER, t_1 );
2961
}
2962
ASS_LVAR_1UP( 5, t_2 );
2963
2964
/* re := re or IsBound( cond[i] ) and not Tester( cond[i] )( arg[i] ) and cond[i]( arg[i] ) and Tester( cond[i] )( arg[i] ); */
2965
t_7 = OBJ_LVAR_1UP( 4 );
2966
CHECK_BOUND( t_7, "re" )
2967
CHECK_BOOL( t_7 )
2968
t_6 = (Obj)(UInt)(t_7 != False);
2969
t_5 = (t_6 ? True : False);
2970
if ( t_5 == False ) {
2971
t_12 = OBJ_LVAR_1UP( 3 );
2972
CHECK_BOUND( t_12, "cond" )
2973
t_13 = OBJ_LVAR_1UP( 5 );
2974
CHECK_BOUND( t_13, "i" )
2975
CHECK_INT_POS( t_13 )
2976
t_11 = C_ISB_LIST( t_12, t_13 );
2977
t_10 = (Obj)(UInt)(t_11 != False);
2978
t_9 = t_10;
2979
if ( t_9 ) {
2980
t_15 = GF_Tester;
2981
t_17 = OBJ_LVAR_1UP( 3 );
2982
CHECK_BOUND( t_17, "cond" )
2983
t_18 = OBJ_LVAR_1UP( 5 );
2984
CHECK_BOUND( t_18, "i" )
2985
CHECK_INT_POS( t_18 )
2986
C_ELM_LIST_FPL( t_16, t_17, t_18 )
2987
t_14 = CALL_1ARGS( t_15, t_16 );
2988
CHECK_FUNC_RESULT( t_14 )
2989
CHECK_FUNC( t_14 )
2990
t_16 = OBJ_LVAR_1UP( 5 );
2991
CHECK_BOUND( t_16, "i" )
2992
CHECK_INT_POS( t_16 )
2993
C_ELM_LIST_FPL( t_15, a_arg, t_16 )
2994
t_13 = CALL_1ARGS( t_14, t_15 );
2995
CHECK_FUNC_RESULT( t_13 )
2996
CHECK_BOOL( t_13 )
2997
t_12 = (Obj)(UInt)(t_13 != False);
2998
t_11 = (Obj)(UInt)( ! ((Int)t_12) );
2999
t_9 = t_11;
3000
}
3001
t_8 = t_9;
3002
if ( t_8 ) {
3003
t_13 = OBJ_LVAR_1UP( 3 );
3004
CHECK_BOUND( t_13, "cond" )
3005
t_14 = OBJ_LVAR_1UP( 5 );
3006
CHECK_BOUND( t_14, "i" )
3007
CHECK_INT_POS( t_14 )
3008
C_ELM_LIST_FPL( t_12, t_13, t_14 )
3009
CHECK_FUNC( t_12 )
3010
t_14 = OBJ_LVAR_1UP( 5 );
3011
CHECK_BOUND( t_14, "i" )
3012
CHECK_INT_POS( t_14 )
3013
C_ELM_LIST_FPL( t_13, a_arg, t_14 )
3014
t_11 = CALL_1ARGS( t_12, t_13 );
3015
CHECK_FUNC_RESULT( t_11 )
3016
CHECK_BOOL( t_11 )
3017
t_10 = (Obj)(UInt)(t_11 != False);
3018
t_8 = t_10;
3019
}
3020
t_7 = t_8;
3021
if ( t_7 ) {
3022
t_12 = GF_Tester;
3023
t_14 = OBJ_LVAR_1UP( 3 );
3024
CHECK_BOUND( t_14, "cond" )
3025
t_15 = OBJ_LVAR_1UP( 5 );
3026
CHECK_BOUND( t_15, "i" )
3027
CHECK_INT_POS( t_15 )
3028
C_ELM_LIST_FPL( t_13, t_14, t_15 )
3029
t_11 = CALL_1ARGS( t_12, t_13 );
3030
CHECK_FUNC_RESULT( t_11 )
3031
CHECK_FUNC( t_11 )
3032
t_13 = OBJ_LVAR_1UP( 5 );
3033
CHECK_BOUND( t_13, "i" )
3034
CHECK_INT_POS( t_13 )
3035
C_ELM_LIST_FPL( t_12, a_arg, t_13 )
3036
t_10 = CALL_1ARGS( t_11, t_12 );
3037
CHECK_FUNC_RESULT( t_10 )
3038
CHECK_BOOL( t_10 )
3039
t_9 = (Obj)(UInt)(t_10 != False);
3040
t_7 = t_9;
3041
}
3042
t_5 = (t_7 ? True : False);
3043
}
3044
ASS_LVAR_1UP( 4, t_5 );
3045
3046
}
3047
/* od */
3048
3049
/* if re then */
3050
t_2 = OBJ_LVAR_1UP( 4 );
3051
CHECK_BOUND( t_2, "re" )
3052
CHECK_BOOL( t_2 )
3053
t_1 = (Obj)(UInt)(t_2 != False);
3054
if ( t_1 ) {
3055
3056
/* return CallFuncList( oper, arg ); */
3057
t_2 = GF_CallFuncList;
3058
t_3 = OBJ_LVAR_1UP( 1 );
3059
CHECK_BOUND( t_3, "oper" )
3060
t_1 = CALL_2ARGS( t_2, t_3, a_arg );
3061
CHECK_FUNC_RESULT( t_1 )
3062
RES_BRK_CURR_STAT();
3063
SWITCH_TO_OLD_FRAME(oldFrame);
3064
return t_1;
3065
3066
}
3067
3068
/* else */
3069
else {
3070
3071
/* return TRY_NEXT_METHOD; */
3072
t_1 = GC_TRY__NEXT__METHOD;
3073
CHECK_BOUND( t_1, "TRY_NEXT_METHOD" )
3074
RES_BRK_CURR_STAT();
3075
SWITCH_TO_OLD_FRAME(oldFrame);
3076
return t_1;
3077
3078
}
3079
/* fi */
3080
3081
/* return; */
3082
RES_BRK_CURR_STAT();
3083
SWITCH_TO_OLD_FRAME(oldFrame);
3084
return 0;
3085
3086
/* return; */
3087
RES_BRK_CURR_STAT();
3088
SWITCH_TO_OLD_FRAME(oldFrame);
3089
return 0;
3090
}
3091
3092
/* handler for function 14 */
3093
static Obj HdlrFunc14 (
3094
Obj self,
3095
Obj a_arg )
3096
{
3097
Obj l_info = 0;
3098
Obj l_fampred = 0;
3099
Obj l_val = 0;
3100
Obj t_1 = 0;
3101
Obj t_2 = 0;
3102
Obj t_3 = 0;
3103
Obj t_4 = 0;
3104
Obj t_5 = 0;
3105
Obj t_6 = 0;
3106
Obj t_7 = 0;
3107
Obj t_8 = 0;
3108
Obj t_9 = 0;
3109
Obj t_10 = 0;
3110
Obj t_11 = 0;
3111
Obj t_12 = 0;
3112
Bag oldFrame;
3113
OLD_BRK_CURR_STAT
3114
3115
/* allocate new stack frame */
3116
SWITCH_TO_NEW_FRAME(self,5,0,oldFrame);
3117
REM_BRK_CURR_STAT();
3118
SET_BRK_CURR_STAT(0);
3119
3120
/* if LEN_LIST( arg ) = 5 then */
3121
t_3 = GF_LEN__LIST;
3122
t_2 = CALL_1ARGS( t_3, a_arg );
3123
CHECK_FUNC_RESULT( t_2 )
3124
t_1 = (Obj)(UInt)(EQ( t_2, INTOBJ_INT(5) ));
3125
if ( t_1 ) {
3126
3127
/* oper := arg[1]; */
3128
C_ELM_LIST_FPL( t_1, a_arg, INTOBJ_INT(1) )
3129
ASS_LVAR( 1, t_1 );
3130
3131
/* info := " fallback method to test conditions"; */
3132
C_NEW_STRING( t_1, 35, " fallback method to test conditions" );
3133
l_info = t_1;
3134
3135
/* fampred := arg[2]; */
3136
C_ELM_LIST_FPL( t_1, a_arg, INTOBJ_INT(2) )
3137
l_fampred = t_1;
3138
3139
/* reqs := arg[3]; */
3140
C_ELM_LIST_FPL( t_1, a_arg, INTOBJ_INT(3) )
3141
ASS_LVAR( 2, t_1 );
3142
3143
/* cond := arg[4]; */
3144
C_ELM_LIST_FPL( t_1, a_arg, INTOBJ_INT(4) )
3145
ASS_LVAR( 3, t_1 );
3146
3147
/* val := arg[5]; */
3148
C_ELM_LIST_FPL( t_1, a_arg, INTOBJ_INT(5) )
3149
l_val = t_1;
3150
3151
}
3152
3153
/* elif LEN_LIST( arg ) = 6 then */
3154
else {
3155
t_3 = GF_LEN__LIST;
3156
t_2 = CALL_1ARGS( t_3, a_arg );
3157
CHECK_FUNC_RESULT( t_2 )
3158
t_1 = (Obj)(UInt)(EQ( t_2, INTOBJ_INT(6) ));
3159
if ( t_1 ) {
3160
3161
/* oper := arg[1]; */
3162
C_ELM_LIST_FPL( t_1, a_arg, INTOBJ_INT(1) )
3163
ASS_LVAR( 1, t_1 );
3164
3165
/* info := arg[2]; */
3166
C_ELM_LIST_FPL( t_1, a_arg, INTOBJ_INT(2) )
3167
l_info = t_1;
3168
3169
/* fampred := arg[3]; */
3170
C_ELM_LIST_FPL( t_1, a_arg, INTOBJ_INT(3) )
3171
l_fampred = t_1;
3172
3173
/* reqs := arg[4]; */
3174
C_ELM_LIST_FPL( t_1, a_arg, INTOBJ_INT(4) )
3175
ASS_LVAR( 2, t_1 );
3176
3177
/* cond := arg[5]; */
3178
C_ELM_LIST_FPL( t_1, a_arg, INTOBJ_INT(5) )
3179
ASS_LVAR( 3, t_1 );
3180
3181
/* val := arg[6]; */
3182
C_ELM_LIST_FPL( t_1, a_arg, INTOBJ_INT(6) )
3183
l_val = t_1;
3184
3185
}
3186
3187
/* else */
3188
else {
3189
3190
/* Error( "Usage: RedispatchOnCondition(oper[,info],fampred,reqs,cond,val)" ); */
3191
t_1 = GF_Error;
3192
C_NEW_STRING( t_2, 63, "Usage: RedispatchOnCondition(oper[,info],fampred,reqs,cond,val)" );
3193
CALL_1ARGS( t_1, t_2 );
3194
3195
}
3196
}
3197
/* fi */
3198
3199
/* for i in reqs do */
3200
t_4 = OBJ_LVAR( 2 );
3201
CHECK_BOUND( t_4, "reqs" )
3202
if ( IS_SMALL_LIST(t_4) ) {
3203
t_3 = (Obj)(UInt)1;
3204
t_1 = INTOBJ_INT(1);
3205
}
3206
else {
3207
t_3 = (Obj)(UInt)0;
3208
t_1 = CALL_1ARGS( GF_ITERATOR, t_4 );
3209
}
3210
while ( 1 ) {
3211
if ( t_3 ) {
3212
if ( LEN_LIST(t_4) < INT_INTOBJ(t_1) ) break;
3213
t_2 = ELMV0_LIST( t_4, INT_INTOBJ(t_1) );
3214
t_1 = (Obj)(((UInt)t_1)+4);
3215
if ( t_2 == 0 ) continue;
3216
}
3217
else {
3218
if ( CALL_1ARGS( GF_IS_DONE_ITER, t_1 ) != False ) break;
3219
t_2 = CALL_1ARGS( GF_NEXT_ITER, t_1 );
3220
}
3221
ASS_LVAR( 5, t_2 );
3222
3223
/* val := val - SIZE_FLAGS( WITH_HIDDEN_IMPS_FLAGS( FLAGS_FILTER( i ) ) ); */
3224
CHECK_BOUND( l_val, "val" )
3225
t_7 = GF_SIZE__FLAGS;
3226
t_9 = GF_WITH__HIDDEN__IMPS__FLAGS;
3227
t_11 = GF_FLAGS__FILTER;
3228
t_12 = OBJ_LVAR( 5 );
3229
CHECK_BOUND( t_12, "i" )
3230
t_10 = CALL_1ARGS( t_11, t_12 );
3231
CHECK_FUNC_RESULT( t_10 )
3232
t_8 = CALL_1ARGS( t_9, t_10 );
3233
CHECK_FUNC_RESULT( t_8 )
3234
t_6 = CALL_1ARGS( t_7, t_8 );
3235
CHECK_FUNC_RESULT( t_6 )
3236
C_DIFF_FIA( t_5, l_val, t_6 )
3237
l_val = t_5;
3238
3239
}
3240
/* od */
3241
3242
/* InstallOtherMethod( oper, info, fampred, reqs, val, function ( arg... )
3243
re := false;
3244
for i in [ 1 .. LEN_LIST( reqs ) ] do
3245
re := re or IsBound( cond[i] ) and not Tester( cond[i] )( arg[i] ) and cond[i]( arg[i] ) and Tester( cond[i] )( arg[i] );
3246
od;
3247
if re then
3248
return CallFuncList( oper, arg );
3249
else
3250
return TRY_NEXT_METHOD;
3251
fi;
3252
return;
3253
end ); */
3254
t_1 = GF_InstallOtherMethod;
3255
t_2 = OBJ_LVAR( 1 );
3256
CHECK_BOUND( t_2, "oper" )
3257
CHECK_BOUND( l_info, "info" )
3258
CHECK_BOUND( l_fampred, "fampred" )
3259
t_3 = OBJ_LVAR( 2 );
3260
CHECK_BOUND( t_3, "reqs" )
3261
t_4 = NewFunction( NameFunc[15], NargFunc[15], NamsFunc[15], HdlrFunc15 );
3262
ENVI_FUNC( t_4 ) = TLS(CurrLVars);
3263
t_5 = NewBag( T_BODY, NUMBER_HEADER_ITEMS_BODY*sizeof(Obj) );
3264
STARTLINE_BODY(t_5) = INTOBJ_INT(855);
3265
ENDLINE_BODY(t_5) = INTOBJ_INT(871);
3266
FILENAME_BODY(t_5) = FileName;
3267
BODY_FUNC(t_4) = t_5;
3268
CHANGED_BAG( TLS(CurrLVars) );
3269
CALL_6ARGS( t_1, t_2, l_info, l_fampred, t_3, l_val, t_4 );
3270
3271
/* return; */
3272
RES_BRK_CURR_STAT();
3273
SWITCH_TO_OLD_FRAME(oldFrame);
3274
return 0;
3275
3276
/* return; */
3277
RES_BRK_CURR_STAT();
3278
SWITCH_TO_OLD_FRAME(oldFrame);
3279
return 0;
3280
}
3281
3282
/* handler for function 1 */
3283
static Obj HdlrFunc1 (
3284
Obj self )
3285
{
3286
Obj t_1 = 0;
3287
Obj t_2 = 0;
3288
Obj t_3 = 0;
3289
Obj t_4 = 0;
3290
Obj t_5 = 0;
3291
Obj t_6 = 0;
3292
Bag oldFrame;
3293
OLD_BRK_CURR_STAT
3294
3295
/* allocate new stack frame */
3296
SWITCH_TO_NEW_FRAME(self,0,0,oldFrame);
3297
REM_BRK_CURR_STAT();
3298
SET_BRK_CURR_STAT(0);
3299
3300
/* RUN_IMMEDIATE_METHODS_CHECKS := 0; */
3301
AssGVar( G_RUN__IMMEDIATE__METHODS__CHECKS, INTOBJ_INT(0) );
3302
3303
/* RUN_IMMEDIATE_METHODS_HITS := 0; */
3304
AssGVar( G_RUN__IMMEDIATE__METHODS__HITS, INTOBJ_INT(0) );
3305
3306
/* BIND_GLOBAL( "RunImmediateMethods", function ( obj, flags )
3307
local flagspos, tried, type, j, imm, i, res, newflags;
3308
if IGNORE_IMMEDIATE_METHODS then
3309
return;
3310
fi;
3311
if IS_SUBSET_FLAGS( IMM_FLAGS, flags ) then
3312
return;
3313
fi;
3314
flags := SUB_FLAGS( flags, IMM_FLAGS );
3315
flagspos := SHALLOW_COPY_OBJ( TRUES_FLAGS( flags ) );
3316
tried := [ ];
3317
type := TYPE_OBJ( obj );
3318
flags := type![2];
3319
for j in flagspos do
3320
if IsBound( IMMEDIATES[j] ) then
3321
imm := IMMEDIATES[j];
3322
for i in [ 0, 7 .. LEN_LIST( imm ) - 7 ] do
3323
if IS_SUBSET_FLAGS( flags, imm[i + 4] ) and not IS_SUBSET_FLAGS( flags, imm[i + 3] ) and not imm[i + 6] in tried then
3324
res := IMMEDIATE_METHODS[imm[i + 6]]( obj );
3325
ADD_LIST( tried, imm[i + 6] );
3326
RUN_IMMEDIATE_METHODS_CHECKS := RUN_IMMEDIATE_METHODS_CHECKS + 1;
3327
if TRACE_IMMEDIATE_METHODS then
3328
if imm[i + 7] = false then
3329
Print( "#I immediate: ", NAME_FUNC( imm[i + 1] ), "\n" );
3330
else
3331
Print( "#I immediate: ", NAME_FUNC( imm[i + 1] ), ": ", imm[i + 7], "\n" );
3332
fi;
3333
fi;
3334
if res <> TRY_NEXT_METHOD then
3335
IGNORE_IMMEDIATE_METHODS := true;
3336
imm[i + 2]( obj, res );
3337
IGNORE_IMMEDIATE_METHODS := false;
3338
RUN_IMMEDIATE_METHODS_HITS := RUN_IMMEDIATE_METHODS_HITS + 1;
3339
if not IS_IDENTICAL_OBJ( TYPE_OBJ( obj ), type ) then
3340
type := TYPE_OBJ( obj );
3341
newflags := SUB_FLAGS( type![2], IMM_FLAGS );
3342
newflags := SUB_FLAGS( newflags, flags );
3343
APPEND_LIST_INTR( flagspos, TRUES_FLAGS( newflags ) );
3344
flags := type![2];
3345
fi;
3346
fi;
3347
fi;
3348
od;
3349
fi;
3350
od;
3351
return;
3352
end ); */
3353
t_1 = GF_BIND__GLOBAL;
3354
C_NEW_STRING( t_2, 19, "RunImmediateMethods" );
3355
t_3 = NewFunction( NameFunc[2], NargFunc[2], NamsFunc[2], HdlrFunc2 );
3356
ENVI_FUNC( t_3 ) = TLS(CurrLVars);
3357
t_4 = NewBag( T_BODY, NUMBER_HEADER_ITEMS_BODY*sizeof(Obj) );
3358
STARTLINE_BODY(t_4) = INTOBJ_INT(26);
3359
ENDLINE_BODY(t_4) = INTOBJ_INT(117);
3360
FILENAME_BODY(t_4) = FileName;
3361
BODY_FUNC(t_3) = t_4;
3362
CHANGED_BAG( TLS(CurrLVars) );
3363
CALL_2ARGS( t_1, t_2, t_3 );
3364
3365
/* BIND_GLOBAL( "INSTALL_METHOD_FLAGS", function ( opr, info, rel, flags, rank, method )
3366
local methods, narg, i, k, tmp, replace, match, j;
3367
if opr in CONSTRUCTORS then
3368
if 0 < LEN_LIST( flags ) then
3369
rank := rank - RankFilter( flags[1] );
3370
fi;
3371
else
3372
for i in flags do
3373
rank := rank + RankFilter( i );
3374
od;
3375
fi;
3376
narg := LEN_LIST( flags );
3377
methods := METHODS_OPERATION( opr, narg );
3378
if info = false then
3379
info := NAME_FUNC( opr );
3380
else
3381
k := SHALLOW_COPY_OBJ( NAME_FUNC( opr ) );
3382
APPEND_LIST_INTR( k, ": " );
3383
APPEND_LIST_INTR( k, info );
3384
info := k;
3385
CONV_STRING( info );
3386
fi;
3387
i := 0;
3388
while i < LEN_LIST( methods ) and rank < methods[i + (narg + 3)] do
3389
i := i + (narg + 4);
3390
od;
3391
replace := false;
3392
if REREADING then
3393
k := i;
3394
while k < LEN_LIST( methods ) and rank = methods[k + narg + 3] do
3395
if info = methods[k + narg + 4] then
3396
match := false;
3397
for j in [ 1 .. narg ] do
3398
match := match and methods[k + j + 1] = flags[j];
3399
od;
3400
if match then
3401
replace := true;
3402
i := k;
3403
break;
3404
fi;
3405
fi;
3406
k := k + narg + 4;
3407
od;
3408
fi;
3409
if not REREADING or not replace then
3410
methods{[ narg + 4 + i + 1 .. narg + 4 + LEN_LIST( methods ) ]} := methods{[ i + 1 .. LEN_LIST( methods ) ]};
3411
fi;
3412
if rel = true then
3413
methods[i + 1] := RETURN_TRUE;
3414
elif rel = false then
3415
methods[i + 1] := RETURN_FALSE;
3416
elif IS_FUNCTION( rel ) then
3417
if CHECK_INSTALL_METHOD then
3418
tmp := NARG_FUNC( rel );
3419
if tmp < AINV( narg ) - 1 or tmp >= 0 and tmp <> narg then
3420
Error( NAME_FUNC( opr ), ": <famrel> must accept ", narg, " arguments" );
3421
fi;
3422
fi;
3423
methods[i + 1] := rel;
3424
else
3425
Error( NAME_FUNC( opr ), ": <famrel> must be a function, `true', or `false'" );
3426
fi;
3427
for k in [ 1 .. narg ] do
3428
methods[i + k + 1] := flags[k];
3429
od;
3430
if method = true then
3431
methods[i + (narg + 2)] := RETURN_TRUE;
3432
elif method = false then
3433
methods[i + (narg + 2)] := RETURN_FALSE;
3434
elif IS_FUNCTION( method ) then
3435
if CHECK_INSTALL_METHOD and not IS_OPERATION( method ) then
3436
tmp := NARG_FUNC( method );
3437
if tmp < AINV( narg ) - 1 or tmp >= 0 and tmp <> narg then
3438
Error( NAME_FUNC( opr ), ": <method> must accept ", narg, " arguments" );
3439
fi;
3440
fi;
3441
methods[i + (narg + 2)] := method;
3442
else
3443
Error( NAME_FUNC( opr ), ": <method> must be a function, `true', or `false'" );
3444
fi;
3445
methods[i + (narg + 3)] := rank;
3446
methods[i + (narg + 4)] := IMMUTABLE_COPY_OBJ( info );
3447
CHANGED_METHODS_OPERATION( opr, narg );
3448
return;
3449
end ); */
3450
t_1 = GF_BIND__GLOBAL;
3451
C_NEW_STRING( t_2, 20, "INSTALL_METHOD_FLAGS" );
3452
t_3 = NewFunction( NameFunc[3], NargFunc[3], NamsFunc[3], HdlrFunc3 );
3453
ENVI_FUNC( t_3 ) = TLS(CurrLVars);
3454
t_4 = NewBag( T_BODY, NUMBER_HEADER_ITEMS_BODY*sizeof(Obj) );
3455
STARTLINE_BODY(t_4) = INTOBJ_INT(124);
3456
ENDLINE_BODY(t_4) = INTOBJ_INT(235);
3457
FILENAME_BODY(t_4) = FileName;
3458
BODY_FUNC(t_3) = t_4;
3459
CHANGED_BAG( TLS(CurrLVars) );
3460
CALL_2ARGS( t_1, t_2, t_3 );
3461
3462
/* BIND_GLOBAL( "InstallMethod", function ( arg... )
3463
INSTALL_METHOD( arg, true );
3464
return;
3465
end ); */
3466
t_1 = GF_BIND__GLOBAL;
3467
C_NEW_STRING( t_2, 13, "InstallMethod" );
3468
t_3 = NewFunction( NameFunc[4], NargFunc[4], NamsFunc[4], HdlrFunc4 );
3469
ENVI_FUNC( t_3 ) = TLS(CurrLVars);
3470
t_4 = NewBag( T_BODY, NUMBER_HEADER_ITEMS_BODY*sizeof(Obj) );
3471
STARTLINE_BODY(t_4) = INTOBJ_INT(282);
3472
ENDLINE_BODY(t_4) = INTOBJ_INT(284);
3473
FILENAME_BODY(t_4) = FileName;
3474
BODY_FUNC(t_3) = t_4;
3475
CHANGED_BAG( TLS(CurrLVars) );
3476
CALL_2ARGS( t_1, t_2, t_3 );
3477
3478
/* BIND_GLOBAL( "InstallOtherMethod", function ( arg... )
3479
INSTALL_METHOD( arg, false );
3480
return;
3481
end ); */
3482
t_1 = GF_BIND__GLOBAL;
3483
C_NEW_STRING( t_2, 18, "InstallOtherMethod" );
3484
t_3 = NewFunction( NameFunc[5], NargFunc[5], NamsFunc[5], HdlrFunc5 );
3485
ENVI_FUNC( t_3 ) = TLS(CurrLVars);
3486
t_4 = NewBag( T_BODY, NUMBER_HEADER_ITEMS_BODY*sizeof(Obj) );
3487
STARTLINE_BODY(t_4) = INTOBJ_INT(309);
3488
ENDLINE_BODY(t_4) = INTOBJ_INT(311);
3489
FILENAME_BODY(t_4) = FileName;
3490
BODY_FUNC(t_3) = t_4;
3491
CHANGED_BAG( TLS(CurrLVars) );
3492
CALL_2ARGS( t_1, t_2, t_3 );
3493
3494
/* DeclareGlobalFunction( "EvalString" ); */
3495
t_1 = GF_DeclareGlobalFunction;
3496
C_NEW_STRING( t_2, 10, "EvalString" );
3497
CALL_1ARGS( t_1, t_2 );
3498
3499
/* Unbind( INSTALL_METHOD ); */
3500
AssGVar( G_INSTALL__METHOD, 0 );
3501
3502
/* BIND_GLOBAL( "INSTALL_METHOD", function ( arglist, check )
3503
local len, opr, info, pos, rel, filters, info1, isstr, flags, i, rank, method, req, reqs, match, j, k, imp, notmatch;
3504
len := LEN_LIST( arglist );
3505
if len < 3 then
3506
Error( "too few arguments given in <arglist>" );
3507
fi;
3508
opr := arglist[1];
3509
if not IS_OPERATION( opr ) then
3510
Error( "<opr> is not an operation" );
3511
fi;
3512
if IS_STRING_REP( arglist[2] ) then
3513
info := arglist[2];
3514
pos := 3;
3515
else
3516
info := false;
3517
pos := 2;
3518
fi;
3519
if arglist[pos] = true or IS_FUNCTION( arglist[pos] ) then
3520
rel := arglist[pos];
3521
pos := pos + 1;
3522
else
3523
rel := true;
3524
fi;
3525
if not IsBound( arglist[pos] ) or not IS_LIST( arglist[pos] ) then
3526
Error( "<arglist>[", pos, "] must be a list of filters" );
3527
fi;
3528
filters := arglist[pos];
3529
if GAPInfo.MaxNrArgsMethod < LEN_LIST( filters ) then
3530
Error( "methods can have at most ", GAPInfo.MaxNrArgsMethod, " arguments" );
3531
fi;
3532
if 0 < LEN_LIST( filters ) then
3533
info1 := "[ ";
3534
isstr := true;
3535
for i in [ 1 .. LEN_LIST( filters ) ] do
3536
if IS_STRING_REP( filters[i] ) then
3537
APPEND_LIST_INTR( info1, filters[i] );
3538
APPEND_LIST_INTR( info1, ", " );
3539
filters[i] := EvalString( filters[i] );
3540
if not IS_FUNCTION( filters[i] ) then
3541
Error( "string does not evaluate to a function" );
3542
fi;
3543
else
3544
isstr := false;
3545
break;
3546
fi;
3547
od;
3548
if isstr and info = false then
3549
info1[LEN_LIST( info1 ) - 1] := ' ';
3550
info1[LEN_LIST( info1 )] := ']';
3551
info := info1;
3552
fi;
3553
fi;
3554
pos := pos + 1;
3555
flags := [ ];
3556
for i in filters do
3557
ADD_LIST( flags, FLAGS_FILTER( i ) );
3558
od;
3559
if not IsBound( arglist[pos] ) then
3560
Error( "the method is missing in <arglist>" );
3561
elif IS_INT( arglist[pos] ) then
3562
rank := arglist[pos];
3563
pos := pos + 1;
3564
else
3565
rank := 0;
3566
fi;
3567
if not IsBound( arglist[pos] ) then
3568
Error( "the method is missing in <arglist>" );
3569
fi;
3570
method := arglist[pos];
3571
if FLAG1_FILTER( opr ) <> 0 and (rel = true or rel = RETURN_TRUE) and LEN_LIST( filters ) = 1 and (method = true or method = RETURN_TRUE) then
3572
Error( NAME_FUNC( opr ), ": use `InstallTrueMethod' for <opr>" );
3573
fi;
3574
if CHECK_INSTALL_METHOD and check then
3575
if opr in WRAPPER_OPERATIONS then
3576
INFO_DEBUG( 1, "a method is installed for the wrapper operation ", NAME_FUNC( opr ), "\n", "#I probably it should be installed for (one of) its\n", "#I underlying operation(s)" );
3577
fi;
3578
req := false;
3579
for i in [ 1, 3 .. LEN_LIST( OPERATIONS ) - 1 ] do
3580
if IS_IDENTICAL_OBJ( OPERATIONS[i], opr ) then
3581
req := OPERATIONS[i + 1];
3582
break;
3583
fi;
3584
od;
3585
if req = false then
3586
Error( "unknown operation ", NAME_FUNC( opr ) );
3587
fi;
3588
imp := [ ];
3589
for i in flags do
3590
ADD_LIST( imp, WITH_HIDDEN_IMPS_FLAGS( i ) );
3591
od;
3592
j := 0;
3593
match := false;
3594
notmatch := 0;
3595
while j < LEN_LIST( req ) and not match do
3596
j := j + 1;
3597
reqs := req[j];
3598
if LEN_LIST( reqs ) = LEN_LIST( imp ) then
3599
match := true;
3600
for i in [ 1 .. LEN_LIST( reqs ) ] do
3601
if not IS_SUBSET_FLAGS( imp[i], reqs[i] ) then
3602
match := false;
3603
notmatch := i;
3604
break;
3605
fi;
3606
od;
3607
if match then
3608
break;
3609
fi;
3610
fi;
3611
od;
3612
if not match then
3613
if notmatch = 0 then
3614
Error( "the number of arguments does not match a declaration of ", NAME_FUNC( opr ) );
3615
else
3616
Error( "required filters ", NamesFilter( imp[notmatch] ), "\nfor ", Ordinal( notmatch ), " argument do not match a declaration of ", NAME_FUNC( opr ) );
3617
fi;
3618
else
3619
for k in [ j + 1 .. LEN_LIST( req ) ] do
3620
reqs := req[k];
3621
if LEN_LIST( reqs ) = LEN_LIST( imp ) then
3622
match := true;
3623
for i in [ 1 .. LEN_LIST( reqs ) ] do
3624
if not IS_SUBSET_FLAGS( imp[i], reqs[i] ) then
3625
match := false;
3626
break;
3627
fi;
3628
od;
3629
if match then
3630
INFO_DEBUG( 1, "method installed for ", NAME_FUNC( opr ), " matches more than one declaration" );
3631
fi;
3632
fi;
3633
od;
3634
fi;
3635
fi;
3636
INSTALL_METHOD_FLAGS( opr, info, rel, flags, rank, method );
3637
return;
3638
end ); */
3639
t_1 = GF_BIND__GLOBAL;
3640
C_NEW_STRING( t_2, 14, "INSTALL_METHOD" );
3641
t_3 = NewFunction( NameFunc[6], NargFunc[6], NamsFunc[6], HdlrFunc6 );
3642
ENVI_FUNC( t_3 ) = TLS(CurrLVars);
3643
t_4 = NewBag( T_BODY, NUMBER_HEADER_ITEMS_BODY*sizeof(Obj) );
3644
STARTLINE_BODY(t_4) = INTOBJ_INT(322);
3645
ENDLINE_BODY(t_4) = INTOBJ_INT(526);
3646
FILENAME_BODY(t_4) = FileName;
3647
BODY_FUNC(t_3) = t_4;
3648
CHANGED_BAG( TLS(CurrLVars) );
3649
CALL_2ARGS( t_1, t_2, t_3 );
3650
3651
/* LENGTH_SETTER_METHODS_2 := LENGTH_SETTER_METHODS_2 + 6; */
3652
t_2 = GC_LENGTH__SETTER__METHODS__2;
3653
CHECK_BOUND( t_2, "LENGTH_SETTER_METHODS_2" )
3654
C_SUM_FIA( t_1, t_2, INTOBJ_INT(6) )
3655
AssGVar( G_LENGTH__SETTER__METHODS__2, t_1 );
3656
3657
/* InstallAttributeFunction( function ( name, filter, getter, setter, tester, mutflag )
3658
local flags, rank, cats, props, i;
3659
if not IS_IDENTICAL_OBJ( filter, IS_OBJECT ) then
3660
flags := FLAGS_FILTER( filter );
3661
rank := 0;
3662
cats := IS_OBJECT;
3663
props := [ ];
3664
for i in [ 1 .. LEN_FLAGS( flags ) ] do
3665
if ELM_FLAGS( flags, i ) then
3666
if i in CATS_AND_REPS then
3667
cats := cats and FILTERS[i];
3668
rank := rank - RankFilter( FILTERS[i] );
3669
elif i in NUMBERS_PROPERTY_GETTERS then
3670
ADD_LIST( props, FILTERS[i] );
3671
fi;
3672
fi;
3673
od;
3674
if 0 < LEN_LIST( props ) then
3675
InstallOtherMethod( getter, "default method requiring categories and checking properties", true, [ cats ], rank, function ( obj )
3676
local found, prop;
3677
found := false;
3678
for prop in props do
3679
if not Tester( prop )( obj ) then
3680
found := true;
3681
if not (prop( obj ) and Tester( prop )( obj )) then
3682
return TRY_NEXT_METHOD;
3683
fi;
3684
fi;
3685
od;
3686
if found then
3687
return getter( obj );
3688
else
3689
return TRY_NEXT_METHOD;
3690
fi;
3691
return;
3692
end );
3693
fi;
3694
fi;
3695
return;
3696
end ); */
3697
t_1 = GF_InstallAttributeFunction;
3698
t_2 = NewFunction( NameFunc[7], NargFunc[7], NamsFunc[7], HdlrFunc7 );
3699
ENVI_FUNC( t_2 ) = TLS(CurrLVars);
3700
t_3 = NewBag( T_BODY, NUMBER_HEADER_ITEMS_BODY*sizeof(Obj) );
3701
STARTLINE_BODY(t_3) = INTOBJ_INT(545);
3702
ENDLINE_BODY(t_3) = INTOBJ_INT(599);
3703
FILENAME_BODY(t_3) = FileName;
3704
BODY_FUNC(t_2) = t_3;
3705
CHANGED_BAG( TLS(CurrLVars) );
3706
CALL_1ARGS( t_1, t_2 );
3707
3708
/* InstallAttributeFunction( function ( name, filter, getter, setter, tester, mutflag )
3709
InstallOtherMethod( setter, "default method, does nothing", true, [ IS_OBJECT, IS_OBJECT ], 0, DO_NOTHING_SETTER );
3710
return;
3711
end ); */
3712
t_1 = GF_InstallAttributeFunction;
3713
t_2 = NewFunction( NameFunc[9], NargFunc[9], NamsFunc[9], HdlrFunc9 );
3714
ENVI_FUNC( t_2 ) = TLS(CurrLVars);
3715
t_3 = NewBag( T_BODY, NUMBER_HEADER_ITEMS_BODY*sizeof(Obj) );
3716
STARTLINE_BODY(t_3) = INTOBJ_INT(602);
3717
ENDLINE_BODY(t_3) = INTOBJ_INT(608);
3718
FILENAME_BODY(t_3) = FileName;
3719
BODY_FUNC(t_2) = t_3;
3720
CHANGED_BAG( TLS(CurrLVars) );
3721
CALL_1ARGS( t_1, t_2 );
3722
3723
/* IsPrimeInt := "2b defined"; */
3724
C_NEW_STRING( t_1, 10, "2b defined" );
3725
AssGVar( G_IsPrimeInt, t_1 );
3726
3727
/* BIND_GLOBAL( "KeyDependentOperation", function ( name, domreq, keyreq, keytest )
3728
local str, oper, attr;
3729
if keytest = "prime" then
3730
keytest := function ( key )
3731
if not IsPrimeInt( key ) then
3732
Error( name, ": <p> must be a prime" );
3733
fi;
3734
return;
3735
end;
3736
fi;
3737
str := SHALLOW_COPY_OBJ( name );
3738
APPEND_LIST_INTR( str, "Op" );
3739
DeclareOperation( str, [ domreq, keyreq ] );
3740
oper := VALUE_GLOBAL( str );
3741
str := "Computed";
3742
APPEND_LIST_INTR( str, name );
3743
APPEND_LIST_INTR( str, "s" );
3744
DeclareAttribute( str, domreq, "mutable" );
3745
attr := VALUE_GLOBAL( str );
3746
InstallMethod( attr, "default method", true, [ domreq ], 0, function ( D )
3747
return [ ];
3748
end );
3749
DeclareOperation( name, [ domreq, keyreq ] );
3750
ADD_LIST( WRAPPER_OPERATIONS, VALUE_GLOBAL( name ) );
3751
InstallOtherMethod( VALUE_GLOBAL( name ), "default method", true, [ domreq, keyreq ], 0, function ( D, key )
3752
local known, i, erg;
3753
keytest( key );
3754
known := attr( D );
3755
i := 1;
3756
while i < LEN_LIST( known ) and known[i] < key do
3757
i := i + 2;
3758
od;
3759
if LEN_LIST( known ) < i or known[i] <> key then
3760
erg := oper( D, key );
3761
known{[ i + 2 .. LEN_LIST( known ) + 2 ]} := known{[ i .. LEN_LIST( known ) ]};
3762
known[i] := key;
3763
known[i + 1] := erg;
3764
fi;
3765
return known[i + 1];
3766
end );
3767
return;
3768
end ); */
3769
t_1 = GF_BIND__GLOBAL;
3770
C_NEW_STRING( t_2, 21, "KeyDependentOperation" );
3771
t_3 = NewFunction( NameFunc[10], NargFunc[10], NamsFunc[10], HdlrFunc10 );
3772
ENVI_FUNC( t_3 ) = TLS(CurrLVars);
3773
t_4 = NewBag( T_BODY, NUMBER_HEADER_ITEMS_BODY*sizeof(Obj) );
3774
STARTLINE_BODY(t_4) = INTOBJ_INT(728);
3775
ENDLINE_BODY(t_4) = INTOBJ_INT(788);
3776
FILENAME_BODY(t_4) = FileName;
3777
BODY_FUNC(t_3) = t_4;
3778
CHANGED_BAG( TLS(CurrLVars) );
3779
CALL_2ARGS( t_1, t_2, t_3 );
3780
3781
/* CallFuncList := "2b defined"; */
3782
C_NEW_STRING( t_1, 10, "2b defined" );
3783
AssGVar( G_CallFuncList, t_1 );
3784
3785
/* BIND_GLOBAL( "RedispatchOnCondition", function ( arg... )
3786
local oper, info, fampred, reqs, cond, val, re, i;
3787
if LEN_LIST( arg ) = 5 then
3788
oper := arg[1];
3789
info := " fallback method to test conditions";
3790
fampred := arg[2];
3791
reqs := arg[3];
3792
cond := arg[4];
3793
val := arg[5];
3794
elif LEN_LIST( arg ) = 6 then
3795
oper := arg[1];
3796
info := arg[2];
3797
fampred := arg[3];
3798
reqs := arg[4];
3799
cond := arg[5];
3800
val := arg[6];
3801
else
3802
Error( "Usage: RedispatchOnCondition(oper[,info],fampred,reqs,cond,val)" );
3803
fi;
3804
for i in reqs do
3805
val := val - SIZE_FLAGS( WITH_HIDDEN_IMPS_FLAGS( FLAGS_FILTER( i ) ) );
3806
od;
3807
InstallOtherMethod( oper, info, fampred, reqs, val, function ( arg... )
3808
re := false;
3809
for i in [ 1 .. LEN_LIST( reqs ) ] do
3810
re := re or IsBound( cond[i] ) and not Tester( cond[i] )( arg[i] ) and cond[i]( arg[i] ) and Tester( cond[i] )( arg[i] );
3811
od;
3812
if re then
3813
return CallFuncList( oper, arg );
3814
else
3815
return TRY_NEXT_METHOD;
3816
fi;
3817
return;
3818
end );
3819
return;
3820
end ); */
3821
t_1 = GF_BIND__GLOBAL;
3822
C_NEW_STRING( t_2, 21, "RedispatchOnCondition" );
3823
t_3 = NewFunction( NameFunc[14], NargFunc[14], NamsFunc[14], HdlrFunc14 );
3824
ENVI_FUNC( t_3 ) = TLS(CurrLVars);
3825
t_4 = NewBag( T_BODY, NUMBER_HEADER_ITEMS_BODY*sizeof(Obj) );
3826
STARTLINE_BODY(t_4) = INTOBJ_INT(823);
3827
ENDLINE_BODY(t_4) = INTOBJ_INT(872);
3828
FILENAME_BODY(t_4) = FileName;
3829
BODY_FUNC(t_3) = t_4;
3830
CHANGED_BAG( TLS(CurrLVars) );
3831
CALL_2ARGS( t_1, t_2, t_3 );
3832
3833
/* InstallMethod( ViewObj, "default method using `PrintObj'", true, [ IS_OBJECT ], 0, PRINT_OBJ ); */
3834
t_1 = GF_InstallMethod;
3835
t_2 = GC_ViewObj;
3836
CHECK_BOUND( t_2, "ViewObj" )
3837
C_NEW_STRING( t_3, 31, "default method using `PrintObj'" );
3838
t_4 = True;
3839
t_5 = NEW_PLIST( T_PLIST, 1 );
3840
SET_LEN_PLIST( t_5, 1 );
3841
t_6 = GC_IS__OBJECT;
3842
CHECK_BOUND( t_6, "IS_OBJECT" )
3843
SET_ELM_PLIST( t_5, 1, t_6 );
3844
CHANGED_BAG( t_5 );
3845
t_6 = GC_PRINT__OBJ;
3846
CHECK_BOUND( t_6, "PRINT_OBJ" )
3847
CALL_6ARGS( t_1, t_2, t_3, t_4, t_5, INTOBJ_INT(0), t_6 );
3848
3849
/* return; */
3850
RES_BRK_CURR_STAT();
3851
SWITCH_TO_OLD_FRAME(oldFrame);
3852
return 0;
3853
3854
/* return; */
3855
RES_BRK_CURR_STAT();
3856
SWITCH_TO_OLD_FRAME(oldFrame);
3857
return 0;
3858
}
3859
3860
/* 'InitKernel' sets up data structures, fopies, copies, handlers */
3861
static Int InitKernel ( StructInitInfo * module )
3862
{
3863
3864
/* global variables used in handlers */
3865
InitCopyGVar( "REREADING", &GC_REREADING );
3866
InitFopyGVar( "SHALLOW_COPY_OBJ", &GF_SHALLOW__COPY__OBJ );
3867
InitCopyGVar( "PRINT_OBJ", &GC_PRINT__OBJ );
3868
InitCopyGVar( "GAPInfo", &GC_GAPInfo );
3869
InitFopyGVar( "IS_FUNCTION", &GF_IS__FUNCTION );
3870
InitFopyGVar( "NAME_FUNC", &GF_NAME__FUNC );
3871
InitFopyGVar( "NARG_FUNC", &GF_NARG__FUNC );
3872
InitFopyGVar( "IS_OPERATION", &GF_IS__OPERATION );
3873
InitFopyGVar( "AINV", &GF_AINV );
3874
InitFopyGVar( "IS_INT", &GF_IS__INT );
3875
InitFopyGVar( "IS_LIST", &GF_IS__LIST );
3876
InitFopyGVar( "ADD_LIST", &GF_ADD__LIST );
3877
InitFopyGVar( "IS_STRING_REP", &GF_IS__STRING__REP );
3878
InitFopyGVar( "Error", &GF_Error );
3879
InitFopyGVar( "TYPE_OBJ", &GF_TYPE__OBJ );
3880
InitFopyGVar( "IMMUTABLE_COPY_OBJ", &GF_IMMUTABLE__COPY__OBJ );
3881
InitFopyGVar( "IS_IDENTICAL_OBJ", &GF_IS__IDENTICAL__OBJ );
3882
InitCopyGVar( "IS_OBJECT", &GC_IS__OBJECT );
3883
InitCopyGVar( "TRY_NEXT_METHOD", &GC_TRY__NEXT__METHOD );
3884
InitFopyGVar( "SUB_FLAGS", &GF_SUB__FLAGS );
3885
InitFopyGVar( "WITH_HIDDEN_IMPS_FLAGS", &GF_WITH__HIDDEN__IMPS__FLAGS );
3886
InitFopyGVar( "IS_SUBSET_FLAGS", &GF_IS__SUBSET__FLAGS );
3887
InitFopyGVar( "TRUES_FLAGS", &GF_TRUES__FLAGS );
3888
InitFopyGVar( "SIZE_FLAGS", &GF_SIZE__FLAGS );
3889
InitFopyGVar( "LEN_FLAGS", &GF_LEN__FLAGS );
3890
InitFopyGVar( "ELM_FLAGS", &GF_ELM__FLAGS );
3891
InitFopyGVar( "FLAG1_FILTER", &GF_FLAG1__FILTER );
3892
InitFopyGVar( "FLAGS_FILTER", &GF_FLAGS__FILTER );
3893
InitFopyGVar( "METHODS_OPERATION", &GF_METHODS__OPERATION );
3894
InitFopyGVar( "CHANGED_METHODS_OPERATION", &GF_CHANGED__METHODS__OPERATION );
3895
InitCopyGVar( "DO_NOTHING_SETTER", &GC_DO__NOTHING__SETTER );
3896
InitCopyGVar( "RETURN_TRUE", &GC_RETURN__TRUE );
3897
InitCopyGVar( "RETURN_FALSE", &GC_RETURN__FALSE );
3898
InitFopyGVar( "LEN_LIST", &GF_LEN__LIST );
3899
InitFopyGVar( "APPEND_LIST_INTR", &GF_APPEND__LIST__INTR );
3900
InitFopyGVar( "CONV_STRING", &GF_CONV__STRING );
3901
InitFopyGVar( "Print", &GF_Print );
3902
InitCopyGVar( "ViewObj", &GC_ViewObj );
3903
InitCopyGVar( "RUN_IMMEDIATE_METHODS_CHECKS", &GC_RUN__IMMEDIATE__METHODS__CHECKS );
3904
InitCopyGVar( "RUN_IMMEDIATE_METHODS_HITS", &GC_RUN__IMMEDIATE__METHODS__HITS );
3905
InitFopyGVar( "BIND_GLOBAL", &GF_BIND__GLOBAL );
3906
InitCopyGVar( "IGNORE_IMMEDIATE_METHODS", &GC_IGNORE__IMMEDIATE__METHODS );
3907
InitCopyGVar( "IMM_FLAGS", &GC_IMM__FLAGS );
3908
InitCopyGVar( "IMMEDIATES", &GC_IMMEDIATES );
3909
InitCopyGVar( "IMMEDIATE_METHODS", &GC_IMMEDIATE__METHODS );
3910
InitCopyGVar( "TRACE_IMMEDIATE_METHODS", &GC_TRACE__IMMEDIATE__METHODS );
3911
InitCopyGVar( "CONSTRUCTORS", &GC_CONSTRUCTORS );
3912
InitFopyGVar( "RankFilter", &GF_RankFilter );
3913
InitCopyGVar( "CHECK_INSTALL_METHOD", &GC_CHECK__INSTALL__METHOD );
3914
InitFopyGVar( "INSTALL_METHOD", &GF_INSTALL__METHOD );
3915
InitFopyGVar( "DeclareGlobalFunction", &GF_DeclareGlobalFunction );
3916
InitFopyGVar( "EvalString", &GF_EvalString );
3917
InitCopyGVar( "WRAPPER_OPERATIONS", &GC_WRAPPER__OPERATIONS );
3918
InitFopyGVar( "INFO_DEBUG", &GF_INFO__DEBUG );
3919
InitCopyGVar( "OPERATIONS", &GC_OPERATIONS );
3920
InitFopyGVar( "NamesFilter", &GF_NamesFilter );
3921
InitFopyGVar( "Ordinal", &GF_Ordinal );
3922
InitFopyGVar( "INSTALL_METHOD_FLAGS", &GF_INSTALL__METHOD__FLAGS );
3923
InitCopyGVar( "LENGTH_SETTER_METHODS_2", &GC_LENGTH__SETTER__METHODS__2 );
3924
InitFopyGVar( "InstallAttributeFunction", &GF_InstallAttributeFunction );
3925
InitCopyGVar( "CATS_AND_REPS", &GC_CATS__AND__REPS );
3926
InitCopyGVar( "FILTERS", &GC_FILTERS );
3927
InitCopyGVar( "NUMBERS_PROPERTY_GETTERS", &GC_NUMBERS__PROPERTY__GETTERS );
3928
InitFopyGVar( "InstallOtherMethod", &GF_InstallOtherMethod );
3929
InitFopyGVar( "Tester", &GF_Tester );
3930
InitFopyGVar( "IsPrimeInt", &GF_IsPrimeInt );
3931
InitFopyGVar( "DeclareOperation", &GF_DeclareOperation );
3932
InitFopyGVar( "VALUE_GLOBAL", &GF_VALUE__GLOBAL );
3933
InitFopyGVar( "DeclareAttribute", &GF_DeclareAttribute );
3934
InitFopyGVar( "InstallMethod", &GF_InstallMethod );
3935
InitFopyGVar( "CallFuncList", &GF_CallFuncList );
3936
3937
/* information for the functions */
3938
InitGlobalBag( &DefaultName, "GAPROOT/lib/oper1.g:DefaultName(-28903883)" );
3939
InitGlobalBag( &FileName, "GAPROOT/lib/oper1.g:FileName(-28903883)" );
3940
InitHandlerFunc( HdlrFunc1, "GAPROOT/lib/oper1.g:HdlrFunc1(-28903883)" );
3941
InitGlobalBag( &(NameFunc[1]), "GAPROOT/lib/oper1.g:NameFunc[1](-28903883)" );
3942
InitHandlerFunc( HdlrFunc2, "GAPROOT/lib/oper1.g:HdlrFunc2(-28903883)" );
3943
InitGlobalBag( &(NameFunc[2]), "GAPROOT/lib/oper1.g:NameFunc[2](-28903883)" );
3944
InitHandlerFunc( HdlrFunc3, "GAPROOT/lib/oper1.g:HdlrFunc3(-28903883)" );
3945
InitGlobalBag( &(NameFunc[3]), "GAPROOT/lib/oper1.g:NameFunc[3](-28903883)" );
3946
InitHandlerFunc( HdlrFunc4, "GAPROOT/lib/oper1.g:HdlrFunc4(-28903883)" );
3947
InitGlobalBag( &(NameFunc[4]), "GAPROOT/lib/oper1.g:NameFunc[4](-28903883)" );
3948
InitHandlerFunc( HdlrFunc5, "GAPROOT/lib/oper1.g:HdlrFunc5(-28903883)" );
3949
InitGlobalBag( &(NameFunc[5]), "GAPROOT/lib/oper1.g:NameFunc[5](-28903883)" );
3950
InitHandlerFunc( HdlrFunc6, "GAPROOT/lib/oper1.g:HdlrFunc6(-28903883)" );
3951
InitGlobalBag( &(NameFunc[6]), "GAPROOT/lib/oper1.g:NameFunc[6](-28903883)" );
3952
InitHandlerFunc( HdlrFunc7, "GAPROOT/lib/oper1.g:HdlrFunc7(-28903883)" );
3953
InitGlobalBag( &(NameFunc[7]), "GAPROOT/lib/oper1.g:NameFunc[7](-28903883)" );
3954
InitHandlerFunc( HdlrFunc8, "GAPROOT/lib/oper1.g:HdlrFunc8(-28903883)" );
3955
InitGlobalBag( &(NameFunc[8]), "GAPROOT/lib/oper1.g:NameFunc[8](-28903883)" );
3956
InitHandlerFunc( HdlrFunc9, "GAPROOT/lib/oper1.g:HdlrFunc9(-28903883)" );
3957
InitGlobalBag( &(NameFunc[9]), "GAPROOT/lib/oper1.g:NameFunc[9](-28903883)" );
3958
InitHandlerFunc( HdlrFunc10, "GAPROOT/lib/oper1.g:HdlrFunc10(-28903883)" );
3959
InitGlobalBag( &(NameFunc[10]), "GAPROOT/lib/oper1.g:NameFunc[10](-28903883)" );
3960
InitHandlerFunc( HdlrFunc11, "GAPROOT/lib/oper1.g:HdlrFunc11(-28903883)" );
3961
InitGlobalBag( &(NameFunc[11]), "GAPROOT/lib/oper1.g:NameFunc[11](-28903883)" );
3962
InitHandlerFunc( HdlrFunc12, "GAPROOT/lib/oper1.g:HdlrFunc12(-28903883)" );
3963
InitGlobalBag( &(NameFunc[12]), "GAPROOT/lib/oper1.g:NameFunc[12](-28903883)" );
3964
InitHandlerFunc( HdlrFunc13, "GAPROOT/lib/oper1.g:HdlrFunc13(-28903883)" );
3965
InitGlobalBag( &(NameFunc[13]), "GAPROOT/lib/oper1.g:NameFunc[13](-28903883)" );
3966
InitHandlerFunc( HdlrFunc14, "GAPROOT/lib/oper1.g:HdlrFunc14(-28903883)" );
3967
InitGlobalBag( &(NameFunc[14]), "GAPROOT/lib/oper1.g:NameFunc[14](-28903883)" );
3968
InitHandlerFunc( HdlrFunc15, "GAPROOT/lib/oper1.g:HdlrFunc15(-28903883)" );
3969
InitGlobalBag( &(NameFunc[15]), "GAPROOT/lib/oper1.g:NameFunc[15](-28903883)" );
3970
3971
/* return success */
3972
return 0;
3973
3974
}
3975
3976
/* 'InitLibrary' sets up gvars, rnams, functions */
3977
static Int InitLibrary ( StructInitInfo * module )
3978
{
3979
Obj func1;
3980
Obj body1;
3981
3982
/* Complete Copy/Fopy registration */
3983
UpdateCopyFopyInfo();
3984
3985
/* global variables used in handlers */
3986
G_REREADING = GVarName( "REREADING" );
3987
G_SHALLOW__COPY__OBJ = GVarName( "SHALLOW_COPY_OBJ" );
3988
G_PRINT__OBJ = GVarName( "PRINT_OBJ" );
3989
G_GAPInfo = GVarName( "GAPInfo" );
3990
G_IS__FUNCTION = GVarName( "IS_FUNCTION" );
3991
G_NAME__FUNC = GVarName( "NAME_FUNC" );
3992
G_NARG__FUNC = GVarName( "NARG_FUNC" );
3993
G_IS__OPERATION = GVarName( "IS_OPERATION" );
3994
G_AINV = GVarName( "AINV" );
3995
G_IS__INT = GVarName( "IS_INT" );
3996
G_IS__LIST = GVarName( "IS_LIST" );
3997
G_ADD__LIST = GVarName( "ADD_LIST" );
3998
G_IS__STRING__REP = GVarName( "IS_STRING_REP" );
3999
G_Error = GVarName( "Error" );
4000
G_TYPE__OBJ = GVarName( "TYPE_OBJ" );
4001
G_IMMUTABLE__COPY__OBJ = GVarName( "IMMUTABLE_COPY_OBJ" );
4002
G_IS__IDENTICAL__OBJ = GVarName( "IS_IDENTICAL_OBJ" );
4003
G_IS__OBJECT = GVarName( "IS_OBJECT" );
4004
G_TRY__NEXT__METHOD = GVarName( "TRY_NEXT_METHOD" );
4005
G_SUB__FLAGS = GVarName( "SUB_FLAGS" );
4006
G_WITH__HIDDEN__IMPS__FLAGS = GVarName( "WITH_HIDDEN_IMPS_FLAGS" );
4007
G_IS__SUBSET__FLAGS = GVarName( "IS_SUBSET_FLAGS" );
4008
G_TRUES__FLAGS = GVarName( "TRUES_FLAGS" );
4009
G_SIZE__FLAGS = GVarName( "SIZE_FLAGS" );
4010
G_LEN__FLAGS = GVarName( "LEN_FLAGS" );
4011
G_ELM__FLAGS = GVarName( "ELM_FLAGS" );
4012
G_FLAG1__FILTER = GVarName( "FLAG1_FILTER" );
4013
G_FLAGS__FILTER = GVarName( "FLAGS_FILTER" );
4014
G_METHODS__OPERATION = GVarName( "METHODS_OPERATION" );
4015
G_CHANGED__METHODS__OPERATION = GVarName( "CHANGED_METHODS_OPERATION" );
4016
G_DO__NOTHING__SETTER = GVarName( "DO_NOTHING_SETTER" );
4017
G_RETURN__TRUE = GVarName( "RETURN_TRUE" );
4018
G_RETURN__FALSE = GVarName( "RETURN_FALSE" );
4019
G_LEN__LIST = GVarName( "LEN_LIST" );
4020
G_APPEND__LIST__INTR = GVarName( "APPEND_LIST_INTR" );
4021
G_CONV__STRING = GVarName( "CONV_STRING" );
4022
G_Print = GVarName( "Print" );
4023
G_ViewObj = GVarName( "ViewObj" );
4024
G_RUN__IMMEDIATE__METHODS__CHECKS = GVarName( "RUN_IMMEDIATE_METHODS_CHECKS" );
4025
G_RUN__IMMEDIATE__METHODS__HITS = GVarName( "RUN_IMMEDIATE_METHODS_HITS" );
4026
G_BIND__GLOBAL = GVarName( "BIND_GLOBAL" );
4027
G_IGNORE__IMMEDIATE__METHODS = GVarName( "IGNORE_IMMEDIATE_METHODS" );
4028
G_IMM__FLAGS = GVarName( "IMM_FLAGS" );
4029
G_IMMEDIATES = GVarName( "IMMEDIATES" );
4030
G_IMMEDIATE__METHODS = GVarName( "IMMEDIATE_METHODS" );
4031
G_TRACE__IMMEDIATE__METHODS = GVarName( "TRACE_IMMEDIATE_METHODS" );
4032
G_CONSTRUCTORS = GVarName( "CONSTRUCTORS" );
4033
G_RankFilter = GVarName( "RankFilter" );
4034
G_CHECK__INSTALL__METHOD = GVarName( "CHECK_INSTALL_METHOD" );
4035
G_INSTALL__METHOD = GVarName( "INSTALL_METHOD" );
4036
G_DeclareGlobalFunction = GVarName( "DeclareGlobalFunction" );
4037
G_EvalString = GVarName( "EvalString" );
4038
G_WRAPPER__OPERATIONS = GVarName( "WRAPPER_OPERATIONS" );
4039
G_INFO__DEBUG = GVarName( "INFO_DEBUG" );
4040
G_OPERATIONS = GVarName( "OPERATIONS" );
4041
G_NamesFilter = GVarName( "NamesFilter" );
4042
G_Ordinal = GVarName( "Ordinal" );
4043
G_INSTALL__METHOD__FLAGS = GVarName( "INSTALL_METHOD_FLAGS" );
4044
G_LENGTH__SETTER__METHODS__2 = GVarName( "LENGTH_SETTER_METHODS_2" );
4045
G_InstallAttributeFunction = GVarName( "InstallAttributeFunction" );
4046
G_CATS__AND__REPS = GVarName( "CATS_AND_REPS" );
4047
G_FILTERS = GVarName( "FILTERS" );
4048
G_NUMBERS__PROPERTY__GETTERS = GVarName( "NUMBERS_PROPERTY_GETTERS" );
4049
G_InstallOtherMethod = GVarName( "InstallOtherMethod" );
4050
G_Tester = GVarName( "Tester" );
4051
G_IsPrimeInt = GVarName( "IsPrimeInt" );
4052
G_DeclareOperation = GVarName( "DeclareOperation" );
4053
G_VALUE__GLOBAL = GVarName( "VALUE_GLOBAL" );
4054
G_DeclareAttribute = GVarName( "DeclareAttribute" );
4055
G_InstallMethod = GVarName( "InstallMethod" );
4056
G_CallFuncList = GVarName( "CallFuncList" );
4057
4058
/* record names used in handlers */
4059
R_MaxNrArgsMethod = RNamName( "MaxNrArgsMethod" );
4060
4061
/* information for the functions */
4062
C_NEW_STRING( DefaultName, 14, "local function" );
4063
C_NEW_STRING( FileName, 19, "GAPROOT/lib/oper1.g" );
4064
NameFunc[1] = DefaultName;
4065
NamsFunc[1] = 0;
4066
NargFunc[1] = 0;
4067
NameFunc[2] = DefaultName;
4068
NamsFunc[2] = 0;
4069
NargFunc[2] = 2;
4070
NameFunc[3] = DefaultName;
4071
NamsFunc[3] = 0;
4072
NargFunc[3] = 6;
4073
NameFunc[4] = DefaultName;
4074
NamsFunc[4] = 0;
4075
NargFunc[4] = -1;
4076
NameFunc[5] = DefaultName;
4077
NamsFunc[5] = 0;
4078
NargFunc[5] = -1;
4079
NameFunc[6] = DefaultName;
4080
NamsFunc[6] = 0;
4081
NargFunc[6] = 2;
4082
NameFunc[7] = DefaultName;
4083
NamsFunc[7] = 0;
4084
NargFunc[7] = 6;
4085
NameFunc[8] = DefaultName;
4086
NamsFunc[8] = 0;
4087
NargFunc[8] = 1;
4088
NameFunc[9] = DefaultName;
4089
NamsFunc[9] = 0;
4090
NargFunc[9] = 6;
4091
NameFunc[10] = DefaultName;
4092
NamsFunc[10] = 0;
4093
NargFunc[10] = 4;
4094
NameFunc[11] = DefaultName;
4095
NamsFunc[11] = 0;
4096
NargFunc[11] = 1;
4097
NameFunc[12] = DefaultName;
4098
NamsFunc[12] = 0;
4099
NargFunc[12] = 1;
4100
NameFunc[13] = DefaultName;
4101
NamsFunc[13] = 0;
4102
NargFunc[13] = 2;
4103
NameFunc[14] = DefaultName;
4104
NamsFunc[14] = 0;
4105
NargFunc[14] = -1;
4106
NameFunc[15] = DefaultName;
4107
NamsFunc[15] = 0;
4108
NargFunc[15] = -1;
4109
4110
/* create all the functions defined in this module */
4111
func1 = NewFunction(NameFunc[1],NargFunc[1],NamsFunc[1],HdlrFunc1);
4112
ENVI_FUNC( func1 ) = TLS(CurrLVars);
4113
CHANGED_BAG( TLS(CurrLVars) );
4114
body1 = NewBag( T_BODY, NUMBER_HEADER_ITEMS_BODY*sizeof(Obj));
4115
BODY_FUNC( func1 ) = body1;
4116
CHANGED_BAG( func1 );
4117
CALL_0ARGS( func1 );
4118
4119
/* return success */
4120
return 0;
4121
4122
}
4123
4124
/* 'PostRestore' restore gvars, rnams, functions */
4125
static Int PostRestore ( StructInitInfo * module )
4126
{
4127
4128
/* global variables used in handlers */
4129
G_REREADING = GVarName( "REREADING" );
4130
G_SHALLOW__COPY__OBJ = GVarName( "SHALLOW_COPY_OBJ" );
4131
G_PRINT__OBJ = GVarName( "PRINT_OBJ" );
4132
G_GAPInfo = GVarName( "GAPInfo" );
4133
G_IS__FUNCTION = GVarName( "IS_FUNCTION" );
4134
G_NAME__FUNC = GVarName( "NAME_FUNC" );
4135
G_NARG__FUNC = GVarName( "NARG_FUNC" );
4136
G_IS__OPERATION = GVarName( "IS_OPERATION" );
4137
G_AINV = GVarName( "AINV" );
4138
G_IS__INT = GVarName( "IS_INT" );
4139
G_IS__LIST = GVarName( "IS_LIST" );
4140
G_ADD__LIST = GVarName( "ADD_LIST" );
4141
G_IS__STRING__REP = GVarName( "IS_STRING_REP" );
4142
G_Error = GVarName( "Error" );
4143
G_TYPE__OBJ = GVarName( "TYPE_OBJ" );
4144
G_IMMUTABLE__COPY__OBJ = GVarName( "IMMUTABLE_COPY_OBJ" );
4145
G_IS__IDENTICAL__OBJ = GVarName( "IS_IDENTICAL_OBJ" );
4146
G_IS__OBJECT = GVarName( "IS_OBJECT" );
4147
G_TRY__NEXT__METHOD = GVarName( "TRY_NEXT_METHOD" );
4148
G_SUB__FLAGS = GVarName( "SUB_FLAGS" );
4149
G_WITH__HIDDEN__IMPS__FLAGS = GVarName( "WITH_HIDDEN_IMPS_FLAGS" );
4150
G_IS__SUBSET__FLAGS = GVarName( "IS_SUBSET_FLAGS" );
4151
G_TRUES__FLAGS = GVarName( "TRUES_FLAGS" );
4152
G_SIZE__FLAGS = GVarName( "SIZE_FLAGS" );
4153
G_LEN__FLAGS = GVarName( "LEN_FLAGS" );
4154
G_ELM__FLAGS = GVarName( "ELM_FLAGS" );
4155
G_FLAG1__FILTER = GVarName( "FLAG1_FILTER" );
4156
G_FLAGS__FILTER = GVarName( "FLAGS_FILTER" );
4157
G_METHODS__OPERATION = GVarName( "METHODS_OPERATION" );
4158
G_CHANGED__METHODS__OPERATION = GVarName( "CHANGED_METHODS_OPERATION" );
4159
G_DO__NOTHING__SETTER = GVarName( "DO_NOTHING_SETTER" );
4160
G_RETURN__TRUE = GVarName( "RETURN_TRUE" );
4161
G_RETURN__FALSE = GVarName( "RETURN_FALSE" );
4162
G_LEN__LIST = GVarName( "LEN_LIST" );
4163
G_APPEND__LIST__INTR = GVarName( "APPEND_LIST_INTR" );
4164
G_CONV__STRING = GVarName( "CONV_STRING" );
4165
G_Print = GVarName( "Print" );
4166
G_ViewObj = GVarName( "ViewObj" );
4167
G_RUN__IMMEDIATE__METHODS__CHECKS = GVarName( "RUN_IMMEDIATE_METHODS_CHECKS" );
4168
G_RUN__IMMEDIATE__METHODS__HITS = GVarName( "RUN_IMMEDIATE_METHODS_HITS" );
4169
G_BIND__GLOBAL = GVarName( "BIND_GLOBAL" );
4170
G_IGNORE__IMMEDIATE__METHODS = GVarName( "IGNORE_IMMEDIATE_METHODS" );
4171
G_IMM__FLAGS = GVarName( "IMM_FLAGS" );
4172
G_IMMEDIATES = GVarName( "IMMEDIATES" );
4173
G_IMMEDIATE__METHODS = GVarName( "IMMEDIATE_METHODS" );
4174
G_TRACE__IMMEDIATE__METHODS = GVarName( "TRACE_IMMEDIATE_METHODS" );
4175
G_CONSTRUCTORS = GVarName( "CONSTRUCTORS" );
4176
G_RankFilter = GVarName( "RankFilter" );
4177
G_CHECK__INSTALL__METHOD = GVarName( "CHECK_INSTALL_METHOD" );
4178
G_INSTALL__METHOD = GVarName( "INSTALL_METHOD" );
4179
G_DeclareGlobalFunction = GVarName( "DeclareGlobalFunction" );
4180
G_EvalString = GVarName( "EvalString" );
4181
G_WRAPPER__OPERATIONS = GVarName( "WRAPPER_OPERATIONS" );
4182
G_INFO__DEBUG = GVarName( "INFO_DEBUG" );
4183
G_OPERATIONS = GVarName( "OPERATIONS" );
4184
G_NamesFilter = GVarName( "NamesFilter" );
4185
G_Ordinal = GVarName( "Ordinal" );
4186
G_INSTALL__METHOD__FLAGS = GVarName( "INSTALL_METHOD_FLAGS" );
4187
G_LENGTH__SETTER__METHODS__2 = GVarName( "LENGTH_SETTER_METHODS_2" );
4188
G_InstallAttributeFunction = GVarName( "InstallAttributeFunction" );
4189
G_CATS__AND__REPS = GVarName( "CATS_AND_REPS" );
4190
G_FILTERS = GVarName( "FILTERS" );
4191
G_NUMBERS__PROPERTY__GETTERS = GVarName( "NUMBERS_PROPERTY_GETTERS" );
4192
G_InstallOtherMethod = GVarName( "InstallOtherMethod" );
4193
G_Tester = GVarName( "Tester" );
4194
G_IsPrimeInt = GVarName( "IsPrimeInt" );
4195
G_DeclareOperation = GVarName( "DeclareOperation" );
4196
G_VALUE__GLOBAL = GVarName( "VALUE_GLOBAL" );
4197
G_DeclareAttribute = GVarName( "DeclareAttribute" );
4198
G_InstallMethod = GVarName( "InstallMethod" );
4199
G_CallFuncList = GVarName( "CallFuncList" );
4200
4201
/* record names used in handlers */
4202
R_MaxNrArgsMethod = RNamName( "MaxNrArgsMethod" );
4203
4204
/* information for the functions */
4205
NameFunc[1] = DefaultName;
4206
NamsFunc[1] = 0;
4207
NargFunc[1] = 0;
4208
NameFunc[2] = DefaultName;
4209
NamsFunc[2] = 0;
4210
NargFunc[2] = 2;
4211
NameFunc[3] = DefaultName;
4212
NamsFunc[3] = 0;
4213
NargFunc[3] = 6;
4214
NameFunc[4] = DefaultName;
4215
NamsFunc[4] = 0;
4216
NargFunc[4] = -1;
4217
NameFunc[5] = DefaultName;
4218
NamsFunc[5] = 0;
4219
NargFunc[5] = -1;
4220
NameFunc[6] = DefaultName;
4221
NamsFunc[6] = 0;
4222
NargFunc[6] = 2;
4223
NameFunc[7] = DefaultName;
4224
NamsFunc[7] = 0;
4225
NargFunc[7] = 6;
4226
NameFunc[8] = DefaultName;
4227
NamsFunc[8] = 0;
4228
NargFunc[8] = 1;
4229
NameFunc[9] = DefaultName;
4230
NamsFunc[9] = 0;
4231
NargFunc[9] = 6;
4232
NameFunc[10] = DefaultName;
4233
NamsFunc[10] = 0;
4234
NargFunc[10] = 4;
4235
NameFunc[11] = DefaultName;
4236
NamsFunc[11] = 0;
4237
NargFunc[11] = 1;
4238
NameFunc[12] = DefaultName;
4239
NamsFunc[12] = 0;
4240
NargFunc[12] = 1;
4241
NameFunc[13] = DefaultName;
4242
NamsFunc[13] = 0;
4243
NargFunc[13] = 2;
4244
NameFunc[14] = DefaultName;
4245
NamsFunc[14] = 0;
4246
NargFunc[14] = -1;
4247
NameFunc[15] = DefaultName;
4248
NamsFunc[15] = 0;
4249
NargFunc[15] = -1;
4250
4251
/* return success */
4252
return 0;
4253
4254
}
4255
4256
4257
/* <name> returns the description of this module */
4258
static StructInitInfo module = {
4259
/* type = */ 2,
4260
/* name = */ "GAPROOT/lib/oper1.g",
4261
/* revision_c = */ 0,
4262
/* revision_h = */ 0,
4263
/* version = */ 0,
4264
/* crc = */ -28903883,
4265
/* initKernel = */ InitKernel,
4266
/* initLibrary = */ InitLibrary,
4267
/* checkInit = */ 0,
4268
/* preSave = */ 0,
4269
/* postSave = */ 0,
4270
/* postRestore = */ PostRestore
4271
};
4272
4273
StructInitInfo * Init__oper1 ( void )
4274
{
4275
return &module;
4276
}
4277
4278
/* compiled code ends here */
4279
#endif
4280
4281