[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [PATCH]: Lua Suggestion - assign functions *or* tables to __pairs/__pairs
- From: Dirk Laurie <dirk.laurie@...>
- Date: Fri, 20 Dec 2013 16:04:33 +0200
2013/12/20 Sir Pogsalot <sir.pogsalot@gmail.com>:
> 3) I'm missing something obvious that makes this a bad idea.
+1
The following pieces of code so the same.
> setmetatable(a,{__pairs=tbl})
> for k,v in pairs(a) do print(k,v) end
> for k,v in pairs(tbl) do print(k,v) end