[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Variable names
- From: "Aaron Brown" <aaron-lua@...>
- Date: Wed, 4 Aug 2004 12:01:11 -0400
Andreas wrote:
> Kind of. I'm trying to replace the old script language in
> my program with Lua and want to keep up compatibility as
> good as it's possible.
I agree with everyone else that, all else being equal,
test = newarray(100)
is the best thing to do. But if you're really interested in
keeping things compatible with the old scripting language,
you could experiment with something based on the following
hack:
Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio
> setmetatable(_G, { __index = function(Junk, Name) return Name end })
> print(glarg)
glarg
>
Then newarray could expect to receive the name of the array
as a string.
--
AARON B.
Farmington Hills, Michigan, U.S.A.