maxima:rtoy-specvars-combin

Last commit made on 2023-01-29
Get this branch:
git clone -b rtoy-specvars-combin https://git.launchpad.net/maxima

Branch merges

Branch information

Name:
rtoy-specvars-combin
Repository:
lp:maxima

Recent commits

773eb9a... by Raymond Toy <email address hidden>

Rename *a* to *combin-a*

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.

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

Rename *ans* to *combin-ans* in combin.lisp

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

6a663eb... by Raymond Toy <email address hidden>

Add defvar for *combin-var*

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.

68c6ad0... by Raymond Toy <email address hidden>

Rename *var* to *combin-var*

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

Full testsuite passes.

643162e... by Raymond Toy <email address hidden>

Remove unneeded declare-top for *var*

In the middle of the file, there's a `declare-top` for the special var
`*var*`. This isn't needed since there's one at the top of the file.

2882e7b... by Raymond Toy <email address hidden>

Change specvar *x* to a lexical var

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

Full testsuite passes.

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

Forgot to remove one special decl of combin-par

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

Rename *i to combin-i

Because Maxima sometimes use `*foo` as a specvar, let's rename `*i` to
`combin-i`. This makes it pretty clear it's not a specvar.

And for consistency since `subsum` takes args `*i` and `e`, make the
new `susum1` take the args in the same order. (We previously had `e`
and `*i`.)

6795d69... by Raymond Toy <email address hidden>

*i does not need to be special

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

Full testsuite passes.

53c65f8... by Raymond Toy <email address hidden>

Replace specvar *p* with lexical var

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.