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

Document use of macros inside of @mutate() #46

Open
kdpsingh opened this issue Sep 11, 2023 · 2 comments
Open

Document use of macros inside of @mutate() #46

kdpsingh opened this issue Sep 11, 2023 · 2 comments

Comments

@kdpsingh
Copy link
Member

Because macros would need to be expanded first to ensure they are properly escaped and vectorized (which isn't supported yet), we should add an example to the documentation about how to wrap macros inside of an anonymous function to ensure proper escaping and vectorization.

We discussed an example here, which we should mention in the documentation: https://discourse.julialang.org/t/trying-to-understand-macro-scope-tidier-package/103635/22?u=kdpsingh

@kdpsingh
Copy link
Member Author

Thinking more about this, we can probably add functionality that will auto-expand macros using a new function like parse_macroexpand() before running parse_autovec(). This way, auto-vectorization should work normally so that anonymous functions aren't even required (though still a good idea to document them).

@kdpsingh
Copy link
Member Author

Should also test if ~(x -> foo(x))(a) syntax works with anonymous functions to prevent all auto-vectorization and give users full control.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant