development release newLISP v9.3.16

Started by Lutz, June 16, 2008, 07:01:57 AM

Previous topic - Next topic

Lutz

• bug fixes for 'randomize' and 'rand'



• a bug fix for 'gs:menu-item-check'



• more corrections in the 9.4.0 manual





for files and CHANGES notes see: http://www.newlisp.org/download/development">http://www.newlisp.org/download/development

DrDave

#1
I was looking at the global function to create global variables. If I make a  variable global, isn't it still possible to create a variable that uses the same variable name inside of a differnt context that is now distinct from the global variable?



If so, should that really be the behavior? Intuitively, I would expect that if a variable is made global that this name would now be unavailable to other contexts for use. To me, as a "casual" programmer, allowing the existence of the same variable name for global plus any other context partially defeats the idea behind the global variable. But maybe otherwise the idea of having a context would be defeated.



However, I can see that perhaps global is just a "convenience" to avoid having to prefix MAIN: to access the global variable when working in another context. And that if global were to behave as I think it should, then it would have to scan all the existing variable names in all contexts to see if that name is already in use.



Of course it is easy enough for me to prefix a "g" to all global variables names to avoid confusion.
...it is better to first strive for clarity and correctness and to make programs efficient only if really needed.

\"Getting Started with Erlang\"  version 5.6.2

HPW

#2
Typo in Link!



http://www.newlisp.org/download/development">http://www.newlisp.org/download/development
Hans-Peter