lua-users home
lua-l archive

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


> Jonathan Adamczewski wrote:
>
> > I have read on the lua-l list that you will be releasing it soon but
> > was hoping that we
> > might be allowed access to your current work.  I realise that it may
> > not be complete
> > but we are prepared to treat it as a beta and help where ever possible
> > in it's completion.
>
> For those who want to try the tolua 4.0,
> there is a alpha version available at
> ftp.tecgraf.puc-rio.br/pub/celes/tolua/tolua-4.0a.tar.gz
>
> I am still working on its performance, and will probably change
> the code (not the interface) in the next days.
> Also, the docs are not up-to-date.
>
> The main changes are:
> - Lua 4.0 compatible (tolua is now reentrant)
> - new support for 'bool' type (mapped to Lua  as 1 or nil)
> - new support for extracting .pkg instruction from real header file
> - fixed bugs reported in this list.
> - no support for overloading relational operators: <=, >=, > (it
> supports < only)
> - the option -a is no longer support (we need the lua state to initalize
> tolua)
>
> feedbacks, suggestions and bug reports are very wellcome.
>
> -- waldemar

I added a keyword "property" to the old tolua 3.2 version that was pretty
useful.  It worked something like this...

C++ class:

class MyClass {

    // Read write property
    int GetValue();
    int SetValue();

   // Readonly property
   int GetValue2();
};

tolua PKG class:

class MyClass {

  property int Value;
  property const int Value2;

};

Then in lua, the Get/Set function pair becomes a propery value which looks
just like a table var.

myinst.Value = 100
i = myinst.Value
i = minst.Value2

I've also noticed that 'tolua' adds a whole lot of string constants
reporting errors, so I took those out.

Ben Cooley
CINEMATIX