[plt-scheme] toy code for doing a ruby-quiz problem (countdown).

From: Danny Yoo (dyoo at hkn.eecs.berkeley.edu)
Date: Mon Jan 29 11:22:43 EST 2007

> However, I am seeing some occasional weirdness that I haven't been able 
> to trace completely yet.
> So the result there is bizarre: somehow, another instance of a NUM is 
> being constructed, but I've taken pains to only instantiate NUMs in a 
> single place.

Ok, traced it.  Good grief, that was silly of me.  The bug was in the way 
I was memoizing expressions: I have to ensure the cache is clean between 
runs.  What happened was that previous runs were interfering with current 
runs.  (I also forgot that equal? dives into structures if the inspector 
is #f.)  I have to be much more careful about state.

The program is still way too slow though; I'll have to see what other 
optimizations I can make to prune the search space.


Posted on the users mailing list.