lua-users home
lua-l archive

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


> > 3) Instead of wrapping <user code> in the template function, could I just
> > push it
> >   as a Lua chunk and pcall()-it ?
> 
> usually yes, but it might be harder to get parameters.  sometimes i
> add a callback to fetch values, so i don't need any parameter.

  chunkwithparameters = "local x,y,z = ...;  return x + y + z"
  
  f = assert(load(chunkwithparameters))
  print(f(3,4,5))

-- Roberto