lua-users home
lua-l archive

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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Shmuel Zeigerman wrote:
[...]
> I'm afraid I don't understand you. It's not `i' (a local variable) that
> should have been munged, but table field names (keys of string type).

Yeah, sorry, it's late.

Try this instead, which is a common idiom:

d = {
	one = 1, [1] = "one",
	two = 2, [2] = "two",
	three = 3, [3] = "three"
}

Renaming field names will horribly mangle this.

My point is that field names are not just arbitrary symbols (like local
variable names). They're actually *data*, which your program may need to
process, and therefore changing them will break your program.

- --
+- David Given --McQ-+ "If you're up against someone more intelligent
|  dg@cowlark.com    | than you are, do something insane and let him think
| (dg@tao-group.com) | himself to death." --- Pyanfar Chanur
+- www.cowlark.com --+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEUqpKf9E0noFvlzgRAtDZAJ4jsoJBPTJlGS1FluRtC8MA9kOccACfdNgT
+waCteq9mxOFthP9ccqHKyg=
=36XM
-----END PGP SIGNATURE-----