As I described here https://stackoverflow.com/a/78110549 I had some issues with saving and loading functions created with lambdify, which I solved by using my own version of lambdify returning an anonymous function:
function generate_func(ex, vars = [])
body = convert(Expr, ex)
if isempty(vars)
syms = Symbol.(free_symbols(ex))
else
syms = Symbol.(vars)
end
fn = eval(:($(Expr(:tuple,syms...)) -> $body));
return(fn)
end
Now I was wondering if there is any reason not to return anonymous functions in the first place. After briefly skipping threw it looks like one perhaps might just have to change one Line in the definition of _lambdify in subs.jl?
As I described here https://stackoverflow.com/a/78110549 I had some issues with saving and loading functions created with lambdify, which I solved by using my own version of lambdify returning an anonymous function:
Now I was wondering if there is any reason not to return anonymous functions in the first place. After briefly skipping threw it looks like one perhaps might just have to change one Line in the definition of _lambdify in subs.jl?
from
to
This would from my understanding allow the saving and loading of the results from lambdify using Serialization .