lua-users home
lua-l archive

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


  Hi.  I wish to allow the user to define classes within LUA that can be
instantiated from the host app (written in C of course).

Something along this line:

myclass={}

function myclass:myfunc()
  --do stuff
end

myclass.n=10

host.RegisterClass(myclass)

  The host application can then create as many instances of that object as
desired within the LUA environment, where each instance's data will be
unique.

  I am currently using lunar to interface my C++ classes with good success,
but I need to allow class-like definitions within LUA as well.
  Thanks.

  Dan East