Menu

#3423 tellsimpafter: circular rule attempted when loading twice package "vect"

None
closed
nobody
5
2018-05-10
2018-04-18
No

If I try to load package vector, when it was already loaded I got an error.

(Maxima 5.37.2 using Lisp GNU Common Lisp (GCL) GCL 2.6.12)
(%i1) load("vect");
(%o1)           /usr/share/maxima/5.37.2/share/vector/vect.mac
(%i2) load("vect");

tellsimpafter: circular rule attempted.
 -- an error. To debug this try: debugmode(true);

My workaround to this is to use:

(%i3) if (get(vect,version)=false) then load("vect")$

My point is that in such case, package vect should signal that it is already loaded (like, for instance, package Cartan does, except that Cartan throws an error, and I would just send a warning when a package was already loaded).

In my case, it took me a little while to realize what the problem was. An error or warning message would have immediately pointed me in the right direction. I would place at the beginning of vect.mac something like

if (get(vect,version)=true) then (warning message) else (actual code)

or

if (get(vect,version)=false) then (actual code)

but since I am relatevely new to maxima I guess there are more elegant ways to do it.

Discussion

  • Robert Dodier

    Robert Dodier - 2018-05-10
    • labels: --> share, vect, load, rules, tellsimpafter
    • status: open --> closed
     
  • Robert Dodier

    Robert Dodier - 2018-05-10

    Fixed by commit bf84eef, which fixes the problem by removing rules before calling tellsimpafter. This is maybe a little heavy handed; see commit message for a comment about that.

     

Log in to post a comment.

MongoDB Logo MongoDB