-
Notifications
You must be signed in to change notification settings - Fork 66
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
Initial draft of Flags Enum Operators proposal. #241
base: main
Are you sure you want to change the base?
Conversation
- Add details of possible layouts for SyntaxNodes and BoundNodes.
Much as I like [and appreciate] the work that this is receiving, I think that using the extension methods (after a relaxation of the generic type parameter rules to allow I find the code below to be more readable Dim someColor As Flags
someColor.Set(Flags.Red)
someColor.Set(Flags.Green)
If Not someColor.IsSet(Flags.Blue) Then
' do something
End If It may be verbose, but it the intent is clearer. Plus, it ties in better with other similar implementations such as Jon Skeet's UnconstranedMelody and Tyler Brinkley's Enums.NET. Note as well that the latter developer is even trying to get some of Enums.NET's improvements into corefx in this proposal which has gained quite a lot of traction. So my opinion is that we try to make design this to look and work similarly rather than coming up with new and potentially obscure operators. My two cents. |
@franzalex I see them as complimentary, the corefx proposal cover the framework api. This covers a possible language support. Akin to ValueTyples I think have a language feature, we could do a form of constant folding on the setting and clearing of flags. |
@franzalex |
Comparisions Quick Token Accumulator SynthesizedMethod.vb |
@AdamSpeight2008 The first step in designing a language feature is to open an issue on the vblang repository requesting or proposing the feature where it can be discussed by the community and the LDM. If and when the LDM believes it has converged on a language approach to the problem identified (note that the LDM starts by considering the problem to be solved), then (and only then) it makes sense to add a specification draft. This PR is premature. |
As proposed the |
#228 does not indicate that the LDM decided on this form of a language feature for the problem. |
I'm considering implementing
|
The following branch has an experimental prototype implementation. stable but don't use on anything vital |
Potential solution for #228
Proposal for Flags Enum Operators.