I'm having trouble using setup_autoload.
----------------------------------------------------------------------------------------------------
(a) My maxima-init.lisp file is (maxima 5.9.0rc3 under Linux and CMUCL)
$ cat maxima-init.lisp
(add2lnc '$set $props)
($setup_autoload "nset.lisp" '$adjoin '$cardinality '$complement
'$disjointp '$dupe '$elementp '$flatten '$full_listify '$fullsetify
'$intersect '$intersection '$listify '$permutations '$powerset
'$setdifference
'$setequality '$setify '$setp '$subpowerset '$subset '$subsetp
'$symmdifference '$union)
----------------------------------------------------------------------------------------------------
(b) The file nset.lisp is in Maxima's path
(C3) system("locate nset.lisp");
locate: warning: database /var/lib/slocate/slocate.db' is more than 8 days
old
/usr/local/share/maxima/5.9.0rc3/share/misc/nset.lisp
(D3) #<process 650 :EXITED>
(C4) quit();
----------------------------------------------------------------------------------------------------
(c) This is what happens
(C1) trace(load,?load);
(D1) [LOAD, LOAD]
(C2) union(set(a),set(b));
1 Enter ?LOAD [nset.lisp]
File-error in function COMMON-LISP::INTERNAL-LOAD: "nset.lisp" does not
exist.
Restarts:
0: [CHECK-AGAIN ] See if it exists now.
1: [USE-VALUE ] Prompt for a new name.
2: [CONTINUE ] Return NIL from load of #p"nset.lisp".
3: [MACSYMA-QUIT] Macsyma top-level
4: [ABORT ] Skip remaining initializations.
Debug (type H for help)
(COMMON-LISP::INTERNAL-LOAD #p"nset.lisp" NIL :ERROR NIL)
Source: Error finding source:
Error in function DEBUG::GET-FILE-TOP-LEVEL-FORM: Source file no longer
exists:
target:code/load.lisp.
0] 3
Maxima restarted.
1 Enter LOAD [maxima-init.lisp]
1 Enter ?LOAD [maxima-init.lisp]
1 Exit ?LOAD TRUE
1 Exit LOAD maxima-init.lisp
Tracing $load and ?load, it seems that ?load gets called instead of $load
-- so Maxima
can't find the file. Is this a bug or is it me? The setup_autoload
statement works okay
if nset.lisp is in the directory where Maxima gets started.
Barton
PS.
(1) nset.lisp is a new set package that Stavros and I have been working
on. It's main
difference with the old package is that it treats lists and sets as
distinct objects:
(C6) s1 : set(a,[a,b],set(a,b));
(D6) {a, {a, b}, [a, b]}
(C7) adjoin(set(a),s1);
(D7) {a, {a}, {a, b}, [a, b]}
My favorite function in the package finds equivalence classes:
(C8) equiv_classes(set(1,2,3,4,5,6),lambda([x,y],is(remainder(x-y,3)=0)));
(D8) {{1, 4}, {2, 5}, {3, 6}}
(C9)
(2) The file names in test.lisp are hardwired. Could we change that?
Maybe
test.lisp should look through all directories under ../share for files
with
names of the form test*.mac.