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

Scoped Names #13

Closed
baumgold opened this issue Feb 27, 2023 · 1 comment · Fixed by #15
Closed

Scoped Names #13

baumgold opened this issue Feb 27, 2023 · 1 comment · Fixed by #15

Comments

@baumgold
Copy link

baumgold commented Feb 27, 2023

Thank you for this package. Unfortunately it has a drawback that the names for instances are not scoped. This means, for example, that it is inconvenient to use "common" names for BitFlag instances, and it is impossible to have multiple BitFlags with the same instance names. Can this package be refactored to accommodate such a structure? The implementation could be similar to that of EnumX.jl.

jmert added a commit that referenced this issue Nov 13, 2023
Extend the capability of the expression generator to wrap the resulting
definitions within a `baremodule`, thereby introducing a scope to
isolate flag value names.

This requires some mild rewiring of the macro expansion to "flip" the
interpretation of the name in `BitFlagName::BaseType` to instead
become the module name, and a new optional first argument adds support
for choosing the actual type name (defaulting to `T`) within the
module.

Fixes #13.
jmert added a commit that referenced this issue Nov 13, 2023
Extend the capability of the expression generator to wrap the resulting
definitions within a `baremodule`, thereby introducing a scope to
isolate flag value names.

This requires some mild rewiring of the macro expansion to "flip" the
interpretation of the name in `BitFlagName::BaseType` to instead
become the module name, and a new optional first argument adds support
for choosing the actual type name (defaulting to `T`) within the
module.

Fixes #13.
jmert added a commit that referenced this issue Nov 13, 2023
Extend the capability of the expression generator to wrap the resulting
definitions within a `baremodule`, thereby introducing a scope to
isolate flag value names.

This requires some mild rewiring of the macro expansion to "flip" the
interpretation of the name in `BitFlagName::BaseType` to instead
become the module name, and a new optional first argument adds support
for choosing the actual type name (defaulting to `T`) within the
module.

Fixes #13.
jmert added a commit that referenced this issue Nov 13, 2023
Extend the capability of the expression generator to wrap the resulting
definitions within a `baremodule`, thereby introducing a scope to
isolate flag value names.

This requires some mild rewiring of the macro expansion to "flip" the
interpretation of the name in `BitFlagName::BaseType` to instead
become the module name, and a new optional first argument adds support
for choosing the actual type name (defaulting to `T`) within the
module.

Fixes #13.
jmert added a commit that referenced this issue Nov 13, 2023
Extend the capability of the expression generator to wrap the resulting
definitions within a `baremodule`, thereby introducing a scope to
isolate flag value names.

This requires some mild rewiring of the macro expansion to "flip" the
interpretation of the name in `BitFlagName::BaseType` to instead
become the module name, and a new optional first argument adds support
for choosing the actual type name (defaulting to `T`) within the
module.

Fixes #13.
@jmert jmert closed this as completed in #15 Nov 13, 2023
jmert added a commit that referenced this issue Nov 13, 2023
Extend the capability of the expression generator to wrap the resulting
definitions within a `baremodule`, thereby introducing a scope to
isolate flag value names.

This requires some mild rewiring of the macro expansion to "flip" the
interpretation of the name in `BitFlagName::BaseType` to instead
become the module name, and a new optional first argument adds support
for choosing the actual type name (defaulting to `T`) within the
module.

Fixes #13.
@jmert
Copy link
Owner

jmert commented Nov 13, 2023

@baumgold I know it's been a long wait, but #15 just added the ability to create scoped bit flags with a new @bitflagx macro. I'll be tagging a new 0.1.8 release shortly.

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 a pull request may close this issue.

2 participants