lua-users home
lua-l archive

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


Mmm... Hi,

   Looks like it is pretty easy to add variable access, if you really
need it. I can try to add it to SLB...

About constructors SLB, supports just one constructor, but with any
kind or number of arguments:
.constructor() <- default
.constructor<int,int>() <- get's two ints

also, from lua, you have some methods to retrieve info from classes
SLB.type(...) -> returns a table with lots of info from the class,
methods, constructors, even comments

If you try SLB please, try the testing branch, which has a lot of
features added:

http://code.google.com/p/slb/source/browse/?r=testing#hg%253Fstate%253Dclosed

... So, let me think how to add the variable accessors, and write a
little example,...

Regards,
   JL.


On Sat, Dec 25, 2010 at 4:46 PM, beo wulf <beowulf@intamp.com> wrote:
> Hi Tim,
>
>   Thanks for the confirmation of "feature-not-supported". :-)
>
> On Fri, Dec 24, 2010 at 12:35 PM, Tim Mensch <tim-lua-l@bitgems.com> wrote:
>>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 12/24/2010 1:54 AM, beo wulf wrote:
>> > I have a largeish project ( ~ 100K LOC ) project currently using luabind
>> > that I plan to switch over to something else ... possibly SLB.
>> >
>> > Pros of SLB: small ( looks like ~ 8K LOC, so readable), compared to
>> > LuaBind ... which I can't understand.
>> >
>> > Cons of SLB: doesn't seem very well documented. I was wondering if
>> > anyone know what the equiv of the following LuaBind constructs are in
>> > SLB:
>> >
>> > (1) variable access
>> >
>> > .def_readwrite("name", &Foo::some_var)  <-- registers ".name" in luacode
>> > to provide read/write access to &Foo::some_var )
>>
>> As far as I can tell, there was no such feature in SLB. If the author
>> sees this, he can comment more definitively, but when I did my binding
>> compare [1], I couldn't find any way to expose member variables, and
>> looking through all the tests, I couldn't find a simple example that had
>> a class with a public variable to expose.
>>
>> > (2) registering constructors
>> >
>> > .def(constructor<....>()) <-- very nice in taht I just specify the types
>> > to the consturctor
>> >
>> > (3) LuaBind has a nice "class info" ... where it can automatically
>> > provide me in lua side code that takes a userdata and returns the C++
>> > class name.
>>
>> I don't know about these two.
>>
>> Tim
>>
>> [1] http://realmensch.org/blog/fun-lua-bindings
>>
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.11 (MingW32)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>>
>> iQEcBAEBAgAGBQJNFQQkAAoJENSbqLBCyKKsL+MIAISH8Y5K1iNsCcamXjt978k6
>> nvimJ1i/2JxaGY/ARHUamfydQ6fEG6rGFsn2UC7a3EJL7yHTIiXITh54NYQ+mDJp
>> MSJNKFHMB4XxixFJIgECE4XGddZ2VhUEdQK/ET852NY+Wx/ifD4CoWRSq1ew889w
>> Iddz1c6tZFUAk32SgaLp0J2/zu3TbxT678EPPUxmsWG6GJTUE3wZsGxF5pKrCUi0
>> 7Gy7fx4AKFPJno4yzN1sJswPIYTP3LB4Pg4fml2CuCvsfqbVBoCoNMn5EvTCUjmb
>> PLPdmFiVx8kdcbkoralGc1OY5+f0ZbmoQSiiuYBFzjOuR+IjStb4aQLjI1TgERQ=
>> =gO3i
>> -----END PGP SIGNATURE-----
>>
>
>



-- 
  Jose L. Hidalgo Valiño (PpluX)
  ---- http://www.pplux.com ----