Open derpyzza opened 2 years ago
I would try fe_tostring(ctx, fe_symbol(ctx, "myvariable"))
You might have to use fe_eval in between: fe_tostring(ctx, fe_eval(ctx, fe_symbol(ctx, "myvariable")))
There's an example of using fe_eval
under "Calling a Function" here: https://github.com/rxi/fe/blob/master/doc/capi.md#calling-a-function
thanks for the reply! i'll try that out
fe_Object *obj = fe_eval(ctx, fe_symbol(ctx, "input"));
Don't forget to take care of restoring the GC stack if you're not doing it inside a fe function.
To avoid creating the 'input' symbol every time (via fe_symbol
), you can create it beforehand. This will be much faster.
like if i had a fe file with the code:
(= input "hello there")
and i wanted to access the value of the input variable in c, how would i do that?