how return nil with luabind::object ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

how return nil with luabind::object ?

Markus Klotzbuecher
Dear List,

I can't figure out a clean way to return lua 'nil' in a
luabind::object from a function. I guess I could pushnil onto the
stack, create the object with from_stack and then pop nil again, but
there must be a better way...

Any ideas?

Thanks!
Markus

------------------------------------------------------------------------------
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: how return nil with luabind::object ?

Iliya Trendafilov
Hi,

I don't have luabind right now and cannot verify my answer, but I'd
expect the default constructor of luabind::object to set the object to
nil. Sorry for the spam if that's obviously wrong.

Ilia

On Thu, Jun 25, 2009 at 4:53 PM, Markus
Klotzbuecher<[hidden email]> wrote:

> Dear List,
>
> I can't figure out a clean way to return lua 'nil' in a
> luabind::object from a function. I guess I could pushnil onto the
> stack, create the object with from_stack and then pop nil again, but
> there must be a better way...
>
> Any ideas?
>
> Thanks!
> Markus
>
> ------------------------------------------------------------------------------
> _______________________________________________
> luabind-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/luabind-user
>

------------------------------------------------------------------------------
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: how return nil with luabind::object ?

Markus Klotzbuecher
On Thu, Jun 25, 2009 at 05:04:59PM +0200, Ilia Trendafilov wrote:

> I don't have luabind right now and cannot verify my answer, but I'd
> expect the default constructor of luabind::object to set the object to
> nil. Sorry for the spam if that's obviously wrong.

No, you're right, that did it!

Thanks!

Markus

------------------------------------------------------------------------------
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user