There is also the situation of variables which are bound in
matching, e.g.
matchdeclare(a, true);
tellsimp(foo(a), bar);
where bar():= ..... a ....
as well as the meaning of
ev(....).
Did anyone really make a "decision"
e.g. ('when did you decide to do dynamic scope?')
It was in the language implementation by Bill Martin, and
presumably seemed just the simplest thing to do, since
Lisp did it.
Dynamic scope has advantages in debugging. It has disadvantages
in that it introduces bugs, if there are name conflicts.
RJF
Stavros Macrakis wrote:
>>>The variable "a" in function
>>>"bar" is free. Maxima has dynamic scope,
>>>
>>>
>>Yes, it seems that I have to accept that.
>>But I am not really happy with it.
>>
>>
>
>Volker, you are unhappy with a design decision; this is not a bug.
>The design decision was made almost 40 years ago, when lexical scope
>in Lisp-like languages was not well understood.
>
>That said, there have been many discussions about changing it. But
>doing it is not just a question of implementation; it is also a
>question of semantics, since Maxima has some interesting cases which
>do not appear in ordinary programming languages, in particular the
>relationship between programming variables which take values and
>symbolic variables.
>
> -s
>