~peterpall/maxima/+git/maxima.code:rtoy-refactor-specvars-sin

Last commit made on 2023-12-26
Get this branch:
git clone -b rtoy-refactor-specvars-sin https://git.launchpad.net/~peterpall/maxima/+git/maxima.code

Branch merges

Branch information

Name:
rtoy-refactor-specvars-sin
Repository:
lp:~peterpall/maxima/+git/maxima.code

Recent commits

553ad45... by Raymond Toy <email address hidden>

Fix up comments

Get rid of the note about *powerl* since we now implement as a closure
over the functions intform and integrator. Add a comment for the
closure.

5d1a6a3... by Raymond Toy <email address hidden>

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.

344b2f8... by Raymond Toy <email address hidden>

*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.

Full testsuite + share passes with cmucl.

e680209... by Raymond Toy <email address hidden>

Rename *ans* to ans in sum-of-intsp

This doesn't need to be the special var. sum-of-intsp only reads from
the arg *ans*, and never sets it, so there's no need for it to be
special.

Full testsuite + share passes with cmucl.

b5f0bcc... by Raymond Toy <email address hidden>

Revert "Make a closure for *ans* for integrate1 and sinint."

This reverts commit 076e6a4bd680beac138a4a8c0a16556107449ec3.

171b2b5... by Raymond Toy <email address hidden>

Rename *powerl* to powerl

*powerl* is no longer special, so remove the *'s.

Remove the nil'ed out special declaration for it too, and the
definition of it in integrator.

Finally, a minor indentation change for some commnets.

076e6a4... by Raymond Toy <email address hidden>

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.

Full testsuite + share passes for cmucl.

190d937... by Raymond Toy <email address hidden>

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.

f05e611... by Raymond Toy <email address hidden>

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.

ac61c77... by Raymond Toy <email address hidden>

Remove unused declaration for stack.