Migrating from B7 to CVS Head

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Migrating from B7 to CVS Head

Josh Green-3
Sorry all,

Am having issues migrating... Some conceptual changes have occurred that
I havn't managed to understand yet.

The following things I used to be able to do, but can't now, could
someone please help!

------Getting a value from the stack into a luabind::object
I used to use:
Object obj(lua);
obj.set();   //Apparently set is no longer a member of object
 
Now I'm trying to use:
Object obj;
Obj = from_stack(lua,-1);
Lua_pop(lua,1)

(This looks pretty sloppy, anyone know what I SHOULD be doing?)
I get this error too:
scriptSystem.cpp(112): error C2679: binary '=' : no operator found which
takes a right-hand operand of type 'luabind::from_stack' (or there is no
acceptable conversion)

I'm guessing this is because the = operator isn't defined for
from_stack... How SHOULD I be doing this?
Something like:
Object obj;
Obj = Object(from_stack(lua,-1));

Like that?

------Pushing a value onto the stack
I used to use:
Obj.pushValue();

Now I'm trying to use:
Obj.push();

I am getting errors like:
scriptSystem.cpp(302): error C2660: 'luabind::adl::object::push' :
function does not take 0 arguments

------Getting the global registry:
Obj = get_globals(lua);

I am now trying:
Obj = globals(lua);

Is this right?

------Copying values from one lua variable to another in Cpp:
I am currently using:
Object lua_self;
Object loadParameters;
(lua_self)["parent"] = loadParameters["parent"];

Doing this gives me the following error:
objects.cpp(157): error C2248:
'luabind::adl::index_proxy<Next>::operator`='' : cannot access private
member declared in class 'luabind::adl::index_proxy<Next>'
        with
        [
            Next=luabind::adl::object
        ]
        and
        [
            Next=luabind::adl::object
        ]


Thanks everyone

--Josh


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: Migrating from B7 to CVS Head

Arvid Norberg-2
On Mon, Jul 31, 2006 at 11:53:38PM +1000, Josh Green wrote:

> Sorry all,
>
> Am having issues migrating... Some conceptual changes have occurred that
> I havn't managed to understand yet.
>
> The following things I used to be able to do, but can't now, could
> someone please help!
>
> ------Getting a value from the stack into a luabind::object
> I used to use:
> Object obj(lua);
> obj.set();   //Apparently set is no longer a member of object

I believe this syntax was removed in the 0.7 release.

>  
> Now I'm trying to use:
> Object obj;
> Obj = from_stack(lua,-1);
> Lua_pop(lua,1)

Right, there's no implicit constructor on object that takes a from_stack
object. If you want to use it in an assignment, you have to be explicit
about creating the new object. i.e.:

obj = object(from_stack(lua, -1));


> (This looks pretty sloppy, anyone know what I SHOULD be doing?)
> I get this error too:
> scriptSystem.cpp(112): error C2679: binary '=' : no operator found which
> takes a right-hand operand of type 'luabind::from_stack' (or there is no
> acceptable conversion)
>
> I'm guessing this is because the = operator isn't defined for
> from_stack... How SHOULD I be doing this?
> Something like:
> Object obj;
> Obj = Object(from_stack(lua,-1));

Exactly. But you don't need to use the assignment operator, you can just
construct it with the from_stack directly:

object obj(from_stack(lua, -1));

> Like that?
>
> ------Pushing a value onto the stack
> I used to use:
> Obj.pushValue();
>
> Now I'm trying to use:
> Obj.push();
>
> I am getting errors like:
> scriptSystem.cpp(302): error C2660: 'luabind::adl::object::push' :
> function does not take 0 arguments

The documentation is obviously outdated here. The new push() takes a
lua_State* as argument.

> ------Getting the global registry:
> Obj = get_globals(lua);
>
> I am now trying:
> Obj = globals(lua);
>
> Is this right?

Yes.

> ------Copying values from one lua variable to another in Cpp:
> I am currently using:
> Object lua_self;
> Object loadParameters;
> (lua_self)["parent"] = loadParameters["parent"];
>
> Doing this gives me the following error:
> objects.cpp(157): error C2248:
> 'luabind::adl::index_proxy<Next>::operator`='' : cannot access private
> member declared in class 'luabind::adl::index_proxy<Next>'
>         with
>         [
>             Next=luabind::adl::object
>         ]
>         and
>         [
>             Next=luabind::adl::object
>         ]

Is this the complete error message?
This is supposed to work at least.

--
Arvid Norberg

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: Migrating from B7 to CVS Head

Josh Green-3
Ok then, thanks for all that!

Am I correct in thinking that there is no-longer a luastate() function
to get the state of the object?
I'm guessing that the luabind::object is now independent of state,
meaning I have to supply my own state
For any operations I want to perform. Right?

As for this one:
>> ------Copying values from one lua variable to another in Cpp: I am
>> currently using: Object lua_self;
>> Object loadParameters;
>> (lua_self)["parent"] = loadParameters["parent"];
>>
>> Doing this gives me the following error:
>> objects.cpp(157): error C2248:
>> 'luabind::adl::index_proxy<Next>::operator`='' : cannot access
private
>> member declared in class 'luabind::adl::index_proxy<Next>'
>>         with
>>         [
>>             Next=luabind::adl::object
>>         ]
>>         and
>>         [
>>             Next=luabind::adl::object
>>         ]

>Is this the complete error message?
>This is supposed to work at least.

>Arvid Norberg


The error message, copy pasted is: (sorry it got truncated last time)

objects.cpp(157) : error C2248:
'luabind::adl::index_proxy<Next>::operator`='' : cannot access private
member declared in class 'luabind::adl::index_proxy<Next>'
        with
        [
            Next=luabind::adl::object
        ]
        and
        [
            Next=luabind::adl::object
        ]
 
d:\Development\Oblivion\Source\Modules\ThirdParty\include\luabind\object
hpp(633) : see declaration of
'luabind::adl::index_proxy<Next>::operator`=''
        with
        [
            Next=luabind::adl::object
        ]

I've got no idea here..
If it is supposed to work then I'm probably doing something wrong, but I
can's see what

Thanks
--Josh


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: Migrating from B7 to CVS Head

Josh Green-3
In reply to this post by Josh Green-3
This still does not work:

Object lua_self;
Object loadParameters;
(lua_self)["parent"] = loadParameters["parent"];
 
Doing this gives me the following error:

objects.cpp(157) : error C2248:
'luabind::adl::index_proxy<Next>::operator`='' : cannot access private
member declared in class 'luabind::adl::index_proxy<Next>'
        with
        [
            Next=luabind::adl::object
        ]
        and
        [
            Next=luabind::adl::object
        ]
 
d:\Development\Oblivion\Source\Modules\ThirdParty\include\luabind\object
hpp(633) : see declaration of
'luabind::adl::index_proxy<Next>::operator`=''
        with
        [
            Next=luabind::adl::object
        ]

----------------------------------------
I have managed to counter this by doing:
(lua_self)["parent"] = Object(loadParameters["parent"]);

But it looked nicer the other way.

--Josh



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user