Pierre Krieger

Results 574 comments of Pierre Krieger

Let's say you write this in C++: ``` lua.writeFunction("Vector2f", "new", [](auto... params) { return Vector2f{params...}; }); ``` This code in Lua : `Vector2f.new(3, 7)` would call `[](float param1, float param2)...

You could still write something like this: ``` struct VectorBuilder { Vector2f operator()(float x, float y) const { return Vector2f{x, y}; } Vector2f operator()(const Vector2f& existing) const { return existing;...

Lambdas with auto are only in C++14, but in my latest comment (https://github.com/Tomaka17/luawrapper/issues/15#issuecomment-38692039) both codes could be done in C++11 However I'm not sure, but I think that variadic lambdas...

I know there is a segfault: https://travis-ci.org/Tomaka17/luawrapper/jobs/23737530 It's probably a bug in LuaJIT, not from the compiler.

Relates to https://github.com/paritytech/smoldot/issues/760 We might be able to remove these `unsafe` blocks after https://github.com/paritytech/smoldot/issues/760 is figured out

Yes, you can. There is no `readFunction`, but there is `readVariable`. Just make sure not to call the `std::function` after the `LuaContext` is destroyed.

I can see three possible behaviors: 1) Force the linkage information to always be the same (it would be less restrictive than today but still wouldn't fix all issues because...

Unfortunately I stopped using Lua a while ago, so I really don't remember much about all this.

Sure! I haven't touched any C++ code for the past year or so, and have no plan to go back to this language, so it's not me who is going...

Just relinking here my comment about smoldot's API: https://github.com/paritytech/substrate/pull/12476#issuecomment-1307828819