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

Add substitute macro(s) #49

Open
Emoun opened this issue Oct 10, 2022 · 2 comments
Open

Add substitute macro(s) #49

Emoun opened this issue Oct 10, 2022 · 2 comments
Labels
D-accepted A decision (D) has been made and the issue will be worked on I-feature This issue (I) regards a (potential) feature in the project T-accepted Triage (T): Initial review accepted issue/PR as valid

Comments

@Emoun
Copy link
Owner

Emoun commented Oct 10, 2022

Short Description:

Provide substitute and substitute_item which only provide the global substitution feature of the main macros.

Motivation:

Sometimes, duplicate may be used only to avoid repeating something within the code, but not to duplicate the whole thing.
Providing these macro would make the intent more clear for readers of the code that no duplication is happening.

Design

Misc:

Provide substitute! and substitute_item as synonyms for duplicate! and duplicate_item respectively, where only global substitutions are allowed.

@Emoun Emoun added D-discussion A decision (D) has not been made yet and is open to discussion I-feature This issue (I) regards a (potential) feature in the project labels Oct 10, 2022
@github-actions github-actions bot added the T-new Triage (T): Has yet to be reviewed label Oct 10, 2022
@Emoun Emoun added T-accepted Triage (T): Initial review accepted issue/PR as valid and removed T-new Triage (T): Has yet to be reviewed labels Oct 10, 2022
@Emoun Emoun added D-accepted A decision (D) has been made and the issue will be worked on and removed D-discussion A decision (D) has not been made yet and is open to discussion labels Oct 17, 2022
@Emoun
Copy link
Owner Author

Emoun commented Mar 4, 2023

For clarity: Currently this is fully supported by duplicate! and duplicate_item. The new macros would just be a more clear way of showing that we are not actually duplicating anything

@Emoun
Copy link
Owner Author

Emoun commented Apr 23, 2024

Initial implementation done.

Missing work:

  • Update root level documentation.
  • Since we are bumping major versions anyway (increased base MSRV), we could change duplicate! and duplicate_item to not allow no duplications.
  • Update changelog
  • Allow nested substitute! calls, like you can with duplicate!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D-accepted A decision (D) has been made and the issue will be worked on I-feature This issue (I) regards a (potential) feature in the project T-accepted Triage (T): Initial review accepted issue/PR as valid
Projects
None yet
Development

No branches or pull requests

1 participant