Local variables not so local within block



Thanks for your reply. I've followed some discussions on the mailing list
in the past about some inconsistencies with the block construct, but the
problems were related to the arguments passed to functions (e.g.
f(x):=block([],....) in wich x was not really local). I didn't expect local
variables to affect global variables. Moreover, only undeclared arrays give
rise to the problem?



> Furthermore, Maxima's implementation of Lisp-2-ness is messy. block([a],
> ...) makes the value local to the block, but not a function definition
> or array or rule. There's nothing about Lisp-2 that requires that, it's
> just an oversight. Sorry about that. Changing this situation is probably
> not too painful, but it does require some devoted focus.
>

Isn't this a bug?


>
> Anyway ... my advice is, try to avoid putting multiple kinds of things
> on Maxima symbols. (Yes, that's right, Maxima will actively work against
> you in that respect. Sorry about that.)
>

I always give different names to different kind of variables, because I had
some problems in the past with lists and undeclared arrays with the same,
so I started to use different names. But if one writes a program and it
grows and becomes more complex, there will be a lot of functions and
functions calling other functions, and it becomes difficult to always use
different names and remember wich have been used, when this names should be
local. Maybe the problem I've described is only related to global-local
variables conflicts, and there is not a conflict between two local
variables inside two different blocks... I'll try this evening because I'm
not on my machine now.


>
> I wrote some code to create lexical symbols in Maxima. Search the
> mailing list archive for "blex" or "lexical block". I can say more about
> that if you're interested.
>

I read about blex, but it use gensym, right? If so, wich is the minimum
Maxima version working with blex? I'm asking this because I need to release
the source code of my program, and maybe such a requirement could not be
the best thing...

Thanks
Stefano