Being able to convert back and forth between julia Expr objects and the custom objects in Impero could allow for a number of useful features. This can be currently achieved by going through SymbolicUtils and using a to_expr function such as
which requires the object to be a SymbolicUtils term object:
to_expr(t::Term) = Expr(:call, operation(t), to_expr.(arguments(t))...)
to_expr(x) = x
but it would be nice to do this directly. This would allow for the plotting of the syntax trees implied by Impero structs via GraphRecipes as in
using GraphRecipes
using Plots
theme(:default)
default(size=(400, 400))
p1 = plot(expr_rhs, shape = :circle, fontsize=10, shorten=0.01, axis_buffer=0.15)
Being able to convert back and forth between julia Expr objects and the custom objects in Impero could allow for a number of useful features. This can be currently achieved by going through SymbolicUtils and using a to_expr function such as which requires the object to be a SymbolicUtils term object:
but it would be nice to do this directly. This would allow for the plotting of the syntax trees implied by Impero structs via GraphRecipes as in
where expr_rhs is an expression object.