Created
October 19, 2010 10:11
-
-
Save garybernhardt/633959 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = function() | |
y = function() | |
local table = 5 | |
end | |
local old_table = table | |
y() | |
assert(table == old_table and table ~= 5) | |
end | |
x() |
Odd.. Works for me too, on another machine.. Starting to think I have a bum build on my fedora machine..
bsmith@ubuntu!1029 J:1 M:command
-> lua
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> x = function()
>> y = function()
>> local table = 5
>> end
>> local old_table = table
>> y()
>> table.insert(old_table, 4)
>> assert(table == old_table and table ~= 5)
>> end
> x()
Also, Nick, try 4 spaces before your snippet to get it to
preserve
Ben, thanks, forgot my Markdown :-(
(or to preview before submitting, :-((
S'cool :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hmm, works for me