lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> About the scope rules: the fact that 'precise declarations' (global <name>)
> take precedence over 'default declarations' (global in <table>) can create
> strange situations.  A block of code that works well in one context no
> longer works in a different one.  I.e. you can't cut'n'paste a function
> from one file to another if it uses 'default declarations'.  You have
> to copy the required 'precise declarations' too or you may get hard to
> find bugs.

You don't need default declarations for this problem. In most languages
you may have problems when you cut'n'paste a function from one file to
another, as its free variables can be captured by external declarations.

-- Roberto