[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Holy arrays vs perfect arrays
- From: HyperHacker <hyperhacker@...>
- Date: Thu, 16 Dec 2010 22:43:25 -0700
On Thu, Dec 16, 2010 at 21:33, Dirk Laurie <dpl@sun.ac.za> wrote:
> On Thu, Dec 16, 2010 at 11:23:24PM +0200, Henning Diedrich wrote:
>>
>> Make it "Could Lua benefit from a more useful, or maybe 'safe',
>> behavior of #t for holy ts?"
> ^^^^^^^
> I love it!
>
> The difference between holiness and perfection:
> ---[[
> sins = { pride=true; covetousness=true; lust=true; anger=true;
> gluttony=true; envy=true; sloth=true }
>
> for k,v in ipairs(t) do if sins[v] then t[k]=nil end end -- holiness
> for i=#t,1,-1 do if sins[v[i]] then t.remove(i) end end -- perfection
> --]]
>
> Of course, you must start from an unholy array t!
>
> Dirk
>
>
>
I don't think that second line is quite "perfection" - what's v?
--
Sent from my toaster.