FluxML / FluxML/MacroTools.jl

`@niceexpand`

Open
#124 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Julia
Stars
320
Forks
84
PR merge metrics
No merged PRs in 30d

Description

I have this code that I use for expanding things.
I think it is like `prettify` but when I tried using `prettify`
it engaged animal names,
which (unlike `gensym_ids`) removes the names of things that were created via `gensym(:meaningful)`

Not sure what to do with it, but it is handy.
Would a PR be useful?

```
using MacroTools
macro niceexpand(code)
code = Base.macroexpand(Main, code, recursive=false)
code = MacroTools.postwalk(MacroTools.unblock, code)
code = MacroTools.postwalk(code) do x
isexpr(x, :escape) ? x.args[1] : x
end
code = MacroTools.gensym_ids(code)
code = MacroTools.striplines(code)
return QuoteNode(code)
end
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.