It's not really clear if `*a*` is the same special var as `*a*` in
other files, but the unspecial at the end hints that it's intended to
be special only in this file.
Therefore, rename `*a*` to `*combin-a*` to make it clear that it's
not. This change did not affect the full testsuite so I'm going to
assume it really is different.
Also, add a `defvar` for it and remove the unspecial declaration at
the end of the file.
Just to prevent any future possible confusion, rename `*ans*` to
`*combin-ans*` and make it a defvar. We can remove the `declare-top`
special and unspecial for this. (Note: combin.lisp is the only place
I can find that uses `*ans*`, but let's make it unique since "ans" is
such a common variable name.)
Add a `defvar` for `*combin-var*` instead of having a `declare-top`.
Not all lisps support `unspecial` so might as well make it a
`defvar`. Then we can remove the `unspecial` declaration at the end
of the file.
`*var*` is used only in combin.lisp and hypgeo.lisp. A comment in
hypgeo.lisp says that `*var*` is global only for that file. Let's
make it so by renaming `*var*` in combin.lisp to `*combin-var*` to
make it definitely different from the one in hypgeo.lisp. Then there
can't be any confusion on whether they're the same or not.
`*x*` is a specvar that is used in a couple of places. We can replace
the specvar by a lexical var by changing `pdecomp*` to take an extra
arg for the (former) specvar. Use `combin-x` as the name to make it
less likely to collide with any other possible var.
`subsum` has the first arg of `*i` and it immediately calls `susum1`,
which is the only place to use `*i`. We can make it lexical by adding
`*i` as an arg to `susum1`. This requires a minor rewriting of the
`recur-apply` lambda.
Now we can remove the `declare-top` `special` for `*i`.
The specvar `*p*` can be replaced by a lexical var by passing in the
value of `*p*` to functions that need it. Then we can get rid of the
special declarations, replacing the specvar with a lexical var.
Rename `*p*` to `combin-par` to make it somewhat unique so as not to
clash inadvertently with some other possible specvar defined
elsewhere.