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

Feature request: bitwise ops or expression syntax for set operations #739

Open
toddlipcon opened this issue May 24, 2024 · 0 comments
Open

Comments

@toddlipcon
Copy link

Often times it's convenient to have a set of flags stored as a single variable (particularly when modeling legacy code). It would be great to support bitwise ops like &, |, ^, ~, etc, for arithmetic, to make this simpler.

Alternatively, one could use set[tMyFlagEnum], but that's also somewhat inconvenient today -- as far as I can tell there is no syntax for a literal set. It would be nice to be able to do:

var s : set[int];
s = {1,2,3};

(or if these features exist, they don't seem to be documented)

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