You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 9, 2026. It is now read-only.
I tried to build this kind of struct to use lambdas with std.json.Value:
conststd=@import("std");
constmustache=@import("mustache");
constNative=struct {
values: std.json.Value,
pubfnmyAwesomeLambda(self: Native, context: mustache.LambdaContext) !void {
// here I am doing awesome things with Native.values
}
}
When I give my Native object as data to the renderAllocText function, it fails with this error:
src/rendering/context.zig:86:9: error: Unexpect context_source: json.dynamic.Value of type [json] and context_source == [native]
Which is undeniably correct.
However I am wondering if there are any tips to use lambdas in a JSON context ?
If not, do you plan something like this ?
If not, will you accept a PR implementing this feature ?
If yes, could you give me some tips to make it possible ? Something like how you see the implementation with more or less details. I will be happy to contribute to this awesome project.
Hi,
I tried to build this kind of struct to use lambdas with
std.json.Value:When I give my
Nativeobject as data to therenderAllocTextfunction, it fails with this error:Which is undeniably correct.
However I am wondering if there are any tips to use lambdas in a JSON context ?
If not, do you plan something like this ?
If not, will you accept a PR implementing this feature ?
If yes, could you give me some tips to make it possible ? Something like how you see the implementation with more or less details. I will be happy to contribute to this awesome project.
Thank you.