1% Get definitions for Reduce functions
2
3lisp;
4on echo, comp, backtrace;
5
6load!-module 'compiler;
7
8% The following line will be left over from the system build if you build
9% bootstrapreduce.img on the system you are now using! If not you need
10% to adjust and activate this.
11
12% @srcdir := "/cygdrive/c/projects/reduce-algebra/trunk/csl/cslbase";
13
14<< m := open("$srcdir/../../src/packages/package.map", 'input);
15   oldi := rds m;
16   off echo;
17   packages := read();
18   on echo;
19   rds oldi;
20   close m >>;
21
22symbolic procedure record!-a!-def(name, modname, type, d);
23  put(name, 'definition, union(get(name, 'definition),
24     list list(modname, type, d)));
25
26symbolic procedure record!-defs!-for!-name(name, modname);
27  begin
28    scalar d, c;
29    if (d := get(name, 'smacro)) and
30       (c := md5 d) neq get(name, 'smacro!-checksum) then <<
31       record!-a!-def(name, modname, 'smacro, d);
32       put(name, 'smacro!-checksum, c) >>;
33    if (d := get(name, '!*savedef)) and
34       (c := md5 d) neq get(name, 'expr!-checksum) then <<
35       record!-a!-def(name, modname, 'expr, d);
36       put(name, 'expr!-checksum, c) >>;
37  end;
38
39symbolic procedure record!-defs modname;
40  for each name in oblist() do record!-defs!-for!-name(name, modname);
41
42record!-defs 'core;
43
44load!-source := t; % So that savedefs get loaded without any checksum checking.
45
46for each modname in packages do if modulep car modname then <<
47%  princ "+++ About to load "; print car modname;
48   load!-source car modname;
49   record!-defs car modname >>;
50
51defined := nil;
52
53for each name in oblist() do
54   if get(name, 'definition) then defined := name . defined;
55
56defined := sort(defined, 'orderp)$
57
58% Here I illustrate what I have collected by displaying cases where
59% there seem to be two (or more) potentially conflicting definitions.
60
61<< terpri();
62   for each name in defined do
63      if length get(name, 'definition) > 1 then <<
64         print name;
65         for each d in get(name, 'definition) do <<
66            princ "Defined as "; prin cadr d;
67            princ " in package "; print car d >>;
68         terpri() >> >>;
69
70end;
71
72