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

Rename define_components! to cgp_preset! with slight improvement #41

Merged
merged 18 commits into from
Dec 8, 2024

Conversation

soareschen
Copy link
Collaborator

@soareschen soareschen commented Dec 8, 2024

Partial work toward #26.

  • Introduce replace_with! macro that allows replacement of an identifier with a list of component types in the body.
  • Introduce for_each_replace! macro that allows repeated replacement of an identifier with each element of components in the list in the body.
  • Rename define_components! to cgp_preset!.
  • Use replace_with! inside the generated with_preset! macro.
  • Re-introduce the IsPreset trait to allow bulk delegation of components.

Note: The current cgp_preset! macro works very poorly when there are generic parameters inside the component name or the preset name. It is currently only usable without generic parameters.

@soareschen soareschen merged commit 287acd4 into main Dec 8, 2024
5 checks passed
@soareschen soareschen deleted the preset-macros branch December 8, 2024 20:10
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

Successfully merging this pull request may close these issues.

1 participant