2 eval_when(batch,ttyoff:true)$
4 12:32pm Friday, 14 January 1983
6 12:00pm Saturday, 15 January 1983
7 At JPG's suggestion, removed dependence on GENUT by bringing in copies of
8 PREDPARTITION and RLOIEWL.
9 10:02am Sunday, 16 January 1983
10 LCM name changed to LCM_L to avoid name conflict with LCM in SHARE;FUNCTS >
15 define_variable:'mode)$
17 put('rncomb,2,'version)$
19 rncombine(exp):=block(
20 [partswitch:true,inflag:true,piece,pfeformat:true],
21 exp:rloiewl("+",combine(exp)),
28 else block([rlist:rest(list),flist:first(list),frlist,
29 partswitch:true,inflag:true,piece],
32 else lcm_l(cons(flist*(frlist:first(rlist))/gcd(flist,frlist),
35 rncombine1(list):=block(
36 [flist,splitdum,lsplitdum,flist_denom],
37 if list=[] then return(0),
40 then return(if inpart(num(flist),0)="+"
41 then rncombine1(args(num(flist)))/denom(flist)
43 flist_denom:(flist_denom:denom(flist))/numfactor(flist_denom),
44 splitdum:predpartition(rest(list),
45 lambda([dum],numberp(denom(dum)/flist_denom))),
46 if (lsplitdum:last(splitdum))#[]
47 then flist:denomthru(cons(flist*flist_denom,lsplitdum*flist_denom))/flist_denom,
48 flist+rncombine1(first(splitdum)))$
50 denomthru(exp):=block(
51 [lcmdum:lcm_l(maplist('denom,exp))],
52 apply("+",lcmdum*exp)/lcmdum)$
54 /* Functions from DGVAL;GENUT FASL: */
56 rloiewl(op,exp):=block(
57 [partswitch:true,inflag:true,piece],
62 predpartition(list,predicate):=block(
63 [nolist:[],yeslist:[]],
64 for idum in reverse(list) do
65 if mode_identity(boolean,apply(predicate,[idum]))
66 then yeslist:cons(idum,yeslist)
67 else nolist:cons(idum,nolist),
70 eval_when(batch,ttyoff:false)$