[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: globals
- From: Markus Huber <pulse@...>
- Date: Sat, 2 Jun 2001 12:36:56 +0200 (BST)
> Reubem Thomas wrote:
> > Markus Huber wrote:
> > No. In both versions failures are depending on
> > the situation. In both versions the failure can
> > be long hidden or found immediately.
> However, local-by-default is easier to debug because
> of one simple thing: it tends to mean that the bug in
> your code is close to the place at which it shows up...
Sure you are right. But I wouldn't like to write this
because its pro local-by-default ;-)
> What I *do* find useful is dynamic scope, as in BBC BASIC,
> so that you can define variables in one procedure, and have
> them accessible in all callees.
- - - That's it what I find extrem usefull too. - - -
*define variables in one procedure,*
*and have them accessible in all callees.*
> But big programs are much easier to debug if you do declare
> globals where they are used...
Ok and what's the solution to access:
the own local and the local from one of the parent functions
if local-by-default?
> Tom wrote:
> More concretely, any variable that
> occurs anywhere on the left hand side of
> ":=" anywhere in a function would be declared
> local to the function (not just local to the block).
Oh no! :-(
Please keep Lua as simple at it is. This is complicated stuff.
--
Markus