Need help with bizarre problem - maybe a new bug?



Hi all.  In my continuing (or renewed) efforts on the unit package, I
have stumbled onto a new, very odd problem with letsimp.  While fixing
some relatively braindead design (hopefully fixing anyway ;-) ) I found
a situation where I need to have a series of letsimp operations applied
in a for loop, with a variable at the end containing the results of the
series of simplificaitons.  The first quirk is that letsimp won't
evaluate the name of a rule set, so I defined a unitletsimp command
using the apply trick.  So far, so good.  But then something else
happens - when I run a loop with letsimp commands, the result keeps
getting assigned 1 rather than the correct output.  What's even MORE
bizarre is that if I either include a print statement of the variable
in question in the for loop, or try to track this down in debug mode,
the problem goes away.  Only in normal operation does this happen.  I
need some insight on what I'm doing wrong - this is driving me batty. 
Here is the relevant part of the debugging session, and the ft.mac file
is attached (ft.mac is my "testing" file for unit package changes -
where the real work goes on, such as it is):

Thanks,
CY

Maxima 5.9.1.1cvs http://maxima.sourceforge.net
Using Lisp SBCL 0.8.20
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
This is a development version of Maxima. The function bug_report()
provides bug reporting information.
(%i1) load("./ft.mac");
(%o1)                              ./ft.mac
(%i2) setunits([N]);
(%o2)                                done
(%i3) :br processunits;

Turning on debugging debugmode(true)
Bkpt 0 for processunits (in /home/user/newunits/./ft.mac line 328) 
(%i3) processunits(kg*m/s^2);
(ft.mac 328)
/home/user/newunits/./ft.mac:328::
(dbm:1) :step;

[snip a bunch more :step operations]

(dbm:1) :step;
(ft.mac 43)
/home/user/newunits/./ft.mac:43::
(dbm:1) unitrules;
Bkpt 0:%forcerules

(dbm:1) result1;
kg m
----
  2
 s

(dbm:1) :step;
(ft.mac 335)
/home/user/newunits/./ft.mac:335::
(dbm:1) result1;
N

(dbm:1) :step;
(ft.mac 336)
/home/user/newunits/./ft.mac:336::
(dbm:1) result1;
N

(dbm:1) :step;
(ft.mac 337)
/home/user/newunits/./ft.mac:337::
(dbm:1) result1;
N

(dbm:1) :step;
(%o3)/R/                               N
(%i4) processunits(kg*m/s^2);
(ft.mac 328)
/home/user/newunits/./ft.mac:328::
(dbm:1) :delete

(dbm:1) :continue
(%o4)/R/                               1
(%i5) 


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/

Attached file: ft.mac