Code cleanup removing unused/unneeded stuff from recent changes
o Remove the note about *ans* which is no longer relevant because the
analysis was wrong and because it didn't need to be special at all.
o Remove nil'ed-out special declaration of *ans*; it's not special
anymore.
o Remove nil'ed-out version of integrate; it got moved into the
closure of powerl.
*ans* does not need to be a special variable at all.
Rename *ans* to ans and comment out the special declaration for *ans*.
In integrate1, it was used to accumulate results and was (mostly)
returned as the value. The only other place was in sinint that set it
as the result (mostly) of integrator and then passed that as the arg
to sum-of-intsp. None of the uses require *ans* to be special.
Make a closure for *ans* for integrate1 and sinint.
As mentioned in the notes, we can create a closure for *ans* that
is used only by integrate1 and sinint. Then we don't need to
declare *ans* to be special anymore, and it's scope is also limited
to just the functions that need it.
Unfortunately doing this rearranges the code a little so stage I
doesn't appear first in the code.
Perhaps an alternative is to just declare *ans* special in
sinint (which sets it) and integrate1 which uses it? The call tree is
complicated.
Make a closure for *powerl* for intform and integrator.
As mentioned in the notes, we can create a closure for *powerl* that
is used only by intform and integrator. Then we don't need to
declare *powerl* to be special anymore, and it's scope is also limited
to just the functions that need it.
Full testsuite + share passes for clisp, cmucl, and ecl.
Add comments on how we might be able to remove some specvars
Describe some ways to get rid of *powerl* and *ans*. Untested, but
these look feasible. Not sure if it's the best, but getting rid of
special variables seems like a big win in terms of readability and
reducing side-effects. (Well, they are in the closure, but at least
we know exactly the functions that need it.)
One minor indentation change to make the code look better and easier
to read since it was indented incorrectly.