User-level namespace system for Maxima



Hello,

I have been working on a user-level namespace system for Maxima.
Here is the code I've churned out thus far:
http://maxima.sourceforge.net/misc/namespaces.lisp
and here are some notes about it:
http://maxima.sourceforge.net/wiki/index.php/User-level%20namespaces%20in%20Maxima

I don't suppose this is very clever, and there are some obvious
misbehaviors.
Mostly I'd just like to get the ball rolling. Comments welcome.

There has been discussion about using CL packages in Maxima,
but it seems to have been focused on reworking Maxima internals.
See: http://maxima.sourceforge.net/wiki/index.php/Maxima%20package%20system

FWIW
Robert

PS. Here is a session log using the code. foo.mac is shown on the wiki page
mentioned above.

(%i1) load ("namespaces.lisp");
(%o1)                    namespaces.lisp
(%i2) import (foo);
(%o2)                   [[foo at g, foo at f]]
(%i3) foo;
(%o3)                    #<$FOO package>
(%i4) symbols (foo);
(%o4)        [foo at g, foo at f, foo at h, foo at my_constant]
(%i5) external_symbols (foo);
(%o5)                    [foo at g, foo at f]
(%i6) my_constant : 1 - %pi;
(%o6)                        1 - %pi
(%i7) foo at my_constant;
(%o7)                         1729
(%i8) h(x) := (1/2) * x^2;
                                  1  2
(%o8)                     h(x) := - x
                                  2
(%i9) apply (dispfun, [f, g, h, foo at h]);
(%t9)          foo at f(x) := foo at my_constant sin(x)

                                                n
(%t10)        foo at g(n) := expand((n! + foo at f(a)) )

                                  1  2
(%t11)                    h(x) := - x
                                  2

(%t12)           foo at h(z) := foo at f(z) - foo at g(2)

(%o12)               [%t9, %t10, %t11, %t12]
(%i13) f(%pi/4);
                              1729
(%o13)                       -------
                             sqrt(2)
(%i14) g(3);
                     3                  2
(%o14) 5168743489 sin (a) + 53809938 sin (a) + 186732 sin(a)
                                                            + 216
(%i15) h(u - v);
                                   2
                            (u - v)
(%o15)                      --------
                               2
(%i16) foo at h(u - v);
                                      2
(%o16) - 1729 sin(v - u) - 2989441 sin (a) - 6916 sin(a) - 4