I'm using the following code instead of RegisterCustomFunction to leverage JUST.net in a C# REPL environment.
#r "nuget: JUST.net, 4.4.1"
using JUST;
using System.Reflection;
var context = new JUSTContext();
var dict = typeof(JUSTContext).GetField("_customFunctions", BindingFlags.NonPublic | BindingFlags.Instance)?.GetValue(context) as Dictionary<string, MethodInfo>;
var func = () => "Hello";
dict["custom"] = func.Method;
new JsonTransformer(context).Transform("""{a:"#custom()"}""", "") // {"a":"Hello"}
I don't want there to be a dynamic loading from the file system when adding custom functions.
I'm using the following code instead of
RegisterCustomFunctionto leverageJUST.netin a C# REPL environment.I don't want there to be a dynamic loading from the file system when adding custom functions.