[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: References (as in Perl)
- From: "Austin Xu Wang" <xu4wang@...>
- Date: Mon, 18 Dec 2006 14:04:21 +0800
I asked the similar question 2 or 3 weeks ago. you can search the list
for "linked variable".
Basicly, as Rici pointed out, there is no such functionality in Lua, a
workaround is using a table to hold a variable..
On 18/12/06, David KOENIG <email@example.com> wrote:
Is there any way to make two variables point to the same exact object,
as with references or typeglob assignment in Perl?
Example in Perl:
$a = 5;
*b = $a;
print $b; #prints 5
$a = 6;
print $b; #prints 6
I've tried messing with _G and all that, but no luck so far.