The macro gets expressions as arguments, these can be
numbers/integers/strings/Symbol's,Expr's etcetera.
You can inspect then by quoting stuff in the repl. If it is an `Expr`
object, then you have `:(a+b).head` -> `call`, `:(a+b).args`. I am not
entirely sure how robust that is. For instance `:(a+b+c)` and
`:(a|b|c)` does something different.(that in particular may warrant a
github issue..) I asked in another thread if maybe they should document
and keep simple the relation between expressions and their
representation.
Anyway, basically your macro can look at those objects, and construct
something. Tbh, rather often i make `Expr`s 'manually' with their
constructor, but if it is clear, you can use quoting. Also, you may
want to escape some stuff from the hygienic macro system(which
automatically replaces symbols with `gensym`s), `esc` does that.
Note that with macros you have to be careful you not to make a mess.
Don't make sublanguages or anything. Be careful about abstraction
leaks. Also be careful not to go too silly using syntax.