[Maxima-commits] Maxima, A Computer Algebra System branch master updated. branch-5_27-base-72-g5287650



On 2012-05-24, Raymond Toy <toy.raymond at gmail.com> wrote:

> I didn't check the diffs in detail, but were some variables defined by both
> defvar and declare-top?  I prefer defvar because you can add docstring.
> Not so easy with declare-top.  And aren't some of the same variables listed
> in declare-top in multiple files?  That sounds like a defvar to me in which
> file is compiled/loaded first.

Well, the distinction I have been making (not that this is entirely
justified) is between declaring variables and defining them. I am
thinking that there should be only one definition. Multiple declarations
are OK, I figure.

For what it's worth, I don't have any problem with replacing DECLARE-TOP
with local DECLARE's. It would be tedious, that's all.

> Definitely agree with getting rid of the unspecial stuff.  That should be
> fairly straightforward since those are obviously intended to be special
> only for that part of the file.  The question is if you really want to put
> a (declare (special foo)) everywhere it's needed.

Well, the unspecial stuff indicates a local scope is intended. How about
if stuff between special/unspecial is wrapped in a lexical block
instead? E.g. replace

  (declare-top (special foo bar))
  (defun f ...)
  (defun g ...)
  (declare-top (unspecial foo bar))

with 

  (let (foo bar)
    (declare (special foo bar))
    (defun f ...)
    (defun g ...))


What do you think?

best

Robert Dodier