MacroTools.jl
MacroTools.jl copied to clipboard
rmlines would be more useful if it worked recursively
rmlines would be more useful it it worked recursively.
rmlines(Meta.parse("""
begin
begin
begin
end
end
end"""))
quote
begin
#= none:3 =#
begin
#= none:4 =#
end
end
end
Yes, one could use postwalk, but I don't think one should have to.
Also, why isn't postwalk exported?
At the very least, the documentation should manage expectations by saying that it doesn'[t work recursively and suggesting the use of postwalk.
The docs seem fine to me? If you feel it can be better written, make a PR.
I can't speak for Mike, but presumably having these functions be non-recursive by default means that you could chain them inside of a single postwalk, which is more efficient than doing N postwalks, so I would keep the current design.
Also, why isn't postwalk exported?
I wouldn't mind exporting them, but... 🤷 Does anyone else have feelings either way?