[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Question about local functions inside functions.
- From: Tom N Harris <telliamed@...>
- Date: Mon, 18 Apr 2016 11:39:30 -0400
On 4/18/2016 10:11 AM, Ulrich Schmidt wrote:
I know. The background of my question was: I like to hide functions inside functions hided inside functions.
This helps me to make excessive use of code folding in ZBS and keeps things as local as possible.
That's what do-end blocks are for.
But i was not sure, it slows down something.
Starting in Lua 5.2, a closure that does not have any upvalues will be
cached and reused.
a = x
local a = x
print(noclosure(1) == noclosure(2))
print(withclosure(1) == withclosure(2))