lua-users home
lua-l archive

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


On Sep 29, 2009, at 4:52 PM, Petite Abeille wrote:


On Sep 30, 2009, at 1:40 AM, Mark Hamburg wrote:

The differences are subtle, but the problems cited above are resolved.

What about something like the following, i.e. avoid inline in the first place:

local function chunk( aFile )
  local aContent = assert( aFile:read( '*a' ) )

  assert( loadstring( aContent ) )

  return aContent
end

luaproc.newproc( chunk( aFile ) )

That requires storing the code for the chunk in a separate file which is fine for complex processes but is a pain for lightweight processes.

Mark