Tip: the first move when trying to write a macro is doing `Meta.@dump` on examples of argument expressions you want your macro to consume and produce. Then write code that transforms the inputs to the outputs.
For example, maybe you want to handle something that looks like:
foo ~~> bar
In lisp syntax (and recall that is what the Julia ast is: everything is a head and then arguments) it might look like: (~~> foo bar)
; or
(op ~~> foo bar)
But if you change to e.g. foo ~~> bar + 5
You might get (+ (~~> foo bar) 5)
Or (~~> foo (progn (+ bar 5)))
I don’t remember what you got or which cases were tricky, only that I could never guess what the output of dump would be.