Re: problems using .def_readwrite and .property when binding classes

Jonathan Capps <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
On Mon, Feb 7, 2011 at 9:32 PM, Nigel Atkinson <[email protected]>wrote:

> Hi Jon,
>
> The last two print statements in your script should print "Hello World".
> It looks like the meta-table setting isn't working correctly.
>
> Try instead of:
>
> a = new Item("testing")
>
> Just:
>
> a = Item("testing")
>
> Nigel
>
> Thanks for your response, Nigel. That "new" was a typo from fingers too
used to C++ -- I couldn't seem to copy/paste from the console window, so I
had to manually copy what was there. I do in fact use

a = Item("testing")

I've looked over the rest of the code, and it appears to be accurate (but my
eyes are tired). Just to see what would happen, I tried

a = new Item("testing")
print(a)                             --prints 'nil', as I expected it would

I had wondered if this issue had something to do with a bad or improperly
set metatable, and I'm glad to have some confirmation, but I'm too much of a
lua newb to know how to diagnose and correct it. Do you have any other ideas
on how to solve this? Google found some other people with the same issue,
but no solutions, so I was hopeful that someone on the mailing list might
have seen it before.

Jon

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb

_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.