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 >
14 define_variable:'mode)$
16 put('rncomb,2,'version)$
18 rncombine(exp):=block(
19 [partswitch:true,inflag:true,piece,pfeformat:true],
20 exp:rloiewl("+",combine(exp)),
27 else block([rlist:rest(list),flist:first(list),frlist,
28 partswitch:true,inflag:true,piece],
31 else lcm_l(cons(flist*(frlist:first(rlist))/gcd(flist,frlist),
34 rncombine1(list):=block(
35 [flist,splitdum,lsplitdum,flist_denom],
36 if list=[] then return(0),
39 then return(if inpart(num(flist),0)="+"
40 then rncombine1(args(num(flist)))/denom(flist)
42 flist_denom:(flist_denom:denom(flist))/numfactor(flist_denom),
43 splitdum:predpartition(rest(list),
44 lambda([dum],numberp(denom(dum)/flist_denom))),
45 if (lsplitdum:last(splitdum))#[]
46 then flist:denomthru(cons(flist*flist_denom,lsplitdum*flist_denom))/flist_denom,
47 flist+rncombine1(first(splitdum)))$
49 denomthru(exp):=block(
50 [lcmdum:lcm_l(maplist('denom,exp))],
51 apply("+",lcmdum*exp)/lcmdum)$
53 /* Functions from DGVAL;GENUT FASL: */
55 rloiewl(op,exp):=block(
56 [partswitch:true,inflag:true,piece],
61 predpartition(list,predicate):=block(
62 [nolist:[],yeslist:[]],
63 for idum in reverse(list) do
64 if mode_identity(boolean,apply(predicate,[idum]))
65 then yeslist:cons(idum,yeslist)
66 else nolist:cons(idum,nolist),
69 eval_when(batch,ttyoff:false)$