Recursive macro call

This works…

julia> macro xx(s, ss...)
           quote
               $(esc(s)) = @xx $(esc.(ss)...)
           end
       end;

julia> macro xx()
           1234
       end
@xx (macro with 2 methods)

julia> (@macroexpand @xx a b c) |> Base.remove_linenums!
quote
    a = begin
            b = begin
                    c = 1234
                end
        end
end

although I would do:

julia> macro y(s::Symbol, ss...)
         _y(s, ss...)
       end;

julia> _y(s, ss...) = :($(esc(s)) = $(_y(ss...)));

julia> _y() = 1234
_y (generic function with 2 methods)

julia> @macroexpand @y a b c
:(a = (b = (c = 1234)))
5 Likes