Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update prewalk and postwalk documentation #11874

Merged
merged 4 commits into from
May 29, 2022

Conversation

iaguirre88
Copy link
Contributor

I realized that the example for prewalk/2 is a bit confusing since some people might assume that 5 + 3 * 7 is transformed to 5 * 3 + 7 while in reality it's transformed into something like 5 * (3 + 7) because the tree shape is not changed.

I think by showing the previous and new AST in the example can be more helpful for the developer.

I also added an example for prewalk/3 and included some references to these functions in the postwalk/2 and postwalk/3

lib/elixir/lib/macro.ex Outdated Show resolved Hide resolved
lib/elixir/lib/macro.ex Outdated Show resolved Hide resolved
lib/elixir/lib/macro.ex Outdated Show resolved Hide resolved
Co-authored-by: Eksperimental <eksperimental@autistici.org>
@josevalim josevalim merged commit 3176951 into elixir-lang:main May 29, 2022
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@iaguirre88 iaguirre88 deleted the update-prewalk-example branch May 30, 2022 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants