[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: [Proposal] debug.getclosure()? (Was: Re: getinfo for activelines on load/loadstring result)
- From: "Soni L." <fakedme@...>
- Date: Thu, 19 Feb 2015 09:46:19 -0200
On 19/02/15 09:39 AM, Roberto Ierusalimschy wrote:
Could this be solved by adding something like debug.getclosure(chunk,
cl_id)? (and functions to instantiate such a closure?)
local b = (loadstring or load)("function a()\n print(1)\n
print(2)\nend\n return a") -- added "return a"
local d = b()
Right, this works, but this is not quite what I'm looking for; this is why
I added "without executing the fragment". The general task is to figure out
the code lines in a file (those that may have breakpoints) without
executing it. I thought that's what activelines gives me, but it doesn't
seem to be the case (or maybe I'm not using it the right way), hence the
Functions in a chunk are only created when you execute the chunk. So,
while you do not run the fragment, there is no "function a" to be talked
I mean, string.dump DOES dump inner closures, doesn't it?
Disclaimer: these emails are public and can be accessed from <TODO: get a non-DHCP IP and put it here>. If you do not agree with this, DO NOT REPLY.