module depend1$ % Enhanced dependence commands % Author: F.J.Wright@Maths.QMW.ac.uk % Date: 17 February 1996 (follows REDUCE 3.6 patch dated 26 Jan 96) % This code enhances the depend and nodepend commands defined in % module depend in alg.red. If the first argument is an (algebraic) % LIST then change the dependency for each element of it, i.e. % (no)depend {y1, y2, ...}, x1, x2, ... maps to % (no)depend y1, x1, x2, ...; (no)depend y2, x1, x2, ...; ... % Also allow a sequence of such dependence sequences, where the % beginning of each new sequence is indicated by a LIST of one or more % dependent variables. % This module is preloaded and so can safely be redefined. % Compile and then load it when required. symbolic procedure depend u; depend!*(u, t)$ symbolic procedure nodepend u; << rmsubs(); depend!*(u, nil) >>$ symbolic procedure depend!*(u, bool); %% u = y,x1,x2,..., {yy1,yy2,...},xx1,xx2,..., OR %% u = {y1,y2,...},x1,x2,..., {yy1,yy2,...},xx1,xx2,..., while u do begin scalar v; %% Make v point to the next dependent variable list or nil: v := cdr u; while v and not rlistp car v do v := cdr v; for each y in (if rlistp car u then cdar u else {car u}) do begin scalar x; x := u; while not((x := cdr x) eq v) do depend1(y, car x, bool); if idp y then << y := intern compress append(explode y,'(!! !_)); x := u; while not((x := cdr x) eq v) do depend1(y, car x, bool) >> end; u := v end$ endmodule$ end$