[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua 5.2 custom array demo
- From: steve donovan <steve.j.donovan@...>
- Date: Sat, 9 Jan 2010 18:45:28 +0200
On Sat, Jan 9, 2010 at 6:27 PM, David Manura <email@example.com> wrote:
> where "::" is basically like a "function()" but allows omitting
> parenthesis in the call.
Such a bit of sugar would also be useful with pcall.
Actually, there's no reason to use rawget/rawset, instead just:
function s.__newindex(t,i,val) t.store[i] = val end
and so forth. Then t.store could be userdata.
Now, it would be cool if table.concat was intelligent enough to
understand such proxy arrays (i.e. use the overloadable ipairs, and
use tostring where applicable) without much performance cost.