I have two long macros that are almost equal, apart from a few lines:

```
macro m1(#= args of m1... =#)
# set some variables in m1 and m2 before returning the expression...
# define some other variables only in m1...
quote
# first part of the body in common to m1 and m2...
# this is only in m1...
# second part in common to m1 and m2...
end
end
macro m2(#= args of m2... =#)
# set some variables in m1 and m2 before returning the expression...
quote
# first part of the body in common to m1 and m2...
# second part in common to m1 and m2...
end
end
```

Whatâ€™s the best strategy to manage this code and reduce code duplication? I guess I should define functions working on expressions, but I donâ€™t really know how to do that in practice, also because given how `@m1`

is defined Iâ€™d need to concatenate multiple `Expr`

and I have no idea how this works.

For the record, the real code Iâ€™d like to simplify and make more maintainable is at https://github.com/JuliaPhysics/PhysicalConstants.jl/blob/144d5dcc75f213a4c28c3c67148ac3632cf8c766/src/PhysicalConstants.jl#L13-L127