I’m trying to figure out a way that doesn’t involve rewriting the same things.
Code generation might be the one I am looking for:
op = (:square, :cube)
for p in op
@eval $p(var::Var) = Var($p(var.x))
end
I’m trying to figure out a way that doesn’t involve rewriting the same things.
Code generation might be the one I am looking for:
op = (:square, :cube)
for p in op
@eval $p(var::Var) = Var($p(var.x))
end