[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Adopting lua for game scripting
- From: Jeremy Ong <jeremycong@...>
- Date: Mon, 24 Mar 2014 12:11:10 -0700
It's even better now.
sel::tie(difference, greeting) = state["subtract_and_hello"](1, 3)
Assuming state is an instance of sel::State.
On Mon, Mar 24, 2014 at 12:09 PM, Camilo Bravo Valdés
<faranwath@gmail.com> wrote:
> On 3/24/14, Jeremy Ong <jeremycong@gmail.com> wrote:
>> As an additional plug, if you have a modern C++11 compiler, you're
>> encouraged to check out Selene [1]. I used it for pretty much exactly
>> what you're doing. I recommend not using the native C api because you
>> give up type safety and keeping track of the stack can be a headache.
>> A good binding library will let the compiler do the work for you.
>>
>> [1] https://github.com/jeremyong/Selene
>
> While reading through the article [1] that presents the library, I
> stumbled upon this:
>
> std::tie(difference, greeting) = l.Call<int,
> std::string>("subtract_and_hello", 1, 3);
>
> Is this actually doable with Selene? I haven't read the whole thing,
> but this syntax I find cute.
>
> [1] http://www.jeremyong.com/blog/2014/01/10/interfacing-lua-with-templates-in-c-plus-plus-11/
>
> -- Camilo
>