Adding a call to a specific function in the main Maxima eval loop?



I don't know if this is the proper way to do this or not, but I'm
trying to find a way to allow a user to chose to have Maxima
automatically simplify things like kg*m/s^2 to N.  Going from N to
kg*m/s^2 is straightforward, but the reverse case is less so.  ratsubst
appears to be able to achieve this (yes I know this example makes
little physical sense, but it is used to demonstrate the abilities
needed):

(%i31) ratsubst(Newton,kg*m/(s^2),Newton^2+kg^2*m^2/s^4+a^(kg*m/s^3));

                                     2    Newton/s
(%o31)                       2 Newton  + a

However, the straightforward toplevel definitions used for most of the
units package are insufficient here.  What is needed (AFAICS) is to add
a call to a function in units.mac to the toplevel eval loop that, when
the regular math is done, performs the user-desired substitutions.  So
questions:

a)  Is this the Right Way to do this?  (This would be done ONLY in the
case where the settings the user enters require it, and would ideally
be undone as soon as it is not needed.)  If not, what is the Right Way?

b)  What do I redefine, and how do I "undo" the redefinition once it is
no longer needed?  Particularly since the function would be in the
"Maxima" language rather than lisp?

Thanks,
CY


		
__________________________________ 
Do you Yahoo!? 
Dress up your holiday email, Hollywood style. Learn more. 
http://celebrity.mail.yahoo.com