[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: importing in local scope
- From: Edgar Toernig <froese@...>
- Date: Wed, 28 Nov 2001 17:01:57 +0100
Pablo Saldo wrote:
>
> Hy everybody,
> How can I "explode" a table in a local scope like:
>
> t = { foo=1, bar=2}
> foo = 2
>
> function foobaz()
> local_explode(t)
> local baz = foo + bar -- baz = 3 (not 4)
> end
>
> print(foo) -- 2 (not 1)
No way. Locals are bound during compile time. You could try
fiddling around with the globals table but I wouldn't recommend
that.
Ciao, ET.