lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> > 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
> question.

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
about.

-- Roberto