Title: feature proposal| flagged enum · Issue #21598 · microsoft/TypeScript · GitHub
Open Graph Title: feature proposal| flagged enum · Issue #21598 · microsoft/TypeScript
X Title: feature proposal| flagged enum · Issue #21598 · microsoft/TypeScript
Description: In many programming languages flags are used to encode options via parameters to functions. It provides a way to eliminate the need of multiple option parameters. My suggestion is to have another feature called "flagged enum". These spec...
Open Graph Description: In many programming languages flags are used to encode options via parameters to functions. It provides a way to eliminate the need of multiple option parameters. My suggestion is to have another f...
X Description: In many programming languages flags are used to encode options via parameters to functions. It provides a way to eliminate the need of multiple option parameters. My suggestion is to have another f...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/21598
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feature proposal| flagged enum","articleBody":"In many programming languages flags are used to encode options via parameters to functions.\r\nIt provides a way to eliminate the need of multiple option parameters.\r\nMy suggestion is to have another feature called \"flagged enum\".\r\nThese special enums will have member that get auto assign to the power of 2.\r\nExample:\r\n`flaggedEnum AnimalFlags{HasClaws ,\r\nCanFly \r\n,EatsFish ,\r\nEndangered\r\n}`\r\n\r\nwill be as to call:\r\n\r\n`enum AnimalFlags{\r\n HasClaws = 1 \u003c\u003c 0,\r\n CanFly = 1 \u003c\u003c 1,\r\n EatsFish = 1 \u003c\u003c 2,\r\n Endangered = 1 \u003c\u003c 3\r\n}\r\n`\r\n\r\nthe different that it will be made automatically of course.\r\n\r\nExample of usage can be read here:\r\n\r\nhttps://basarat.gitbooks.io/typescript/docs/enums.html#enums-as-flags\r\n\r\n","author":{"url":"https://github.com/exx8","@type":"Person","name":"exx8"},"datePublished":"2018-02-03T09:58:52Z","url":"https://github.com/microsoft/TypeScript/issues/21598"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:222a0d64-8d4d-9065-cb1b-2674279076cd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E69A:222D8A:853D98:BAB22C:6B048105 |
| html-safe-nonce | 84b05a65e3a492be6285d47a136f300aba8e615f6bff22bbb88fb4d3b50a524f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjlBOjIyMkQ4QTo4NTNEOTg6QkFCMjJDOjZCMDQ4MTA1IiwidmlzaXRvcl9pZCI6IjQ1ODkwMjAwMDQ2MjgwNzA2NjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f6009bdf192707c9a905342c0cddde6a4b3139f62735ffeed88faf3d218744c0 |
| hovercard-subject-tag | issue:294099378 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/21598/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9a41e4916b5d0b29e1b67ef25ccab48de2c6b175a7f54032ae810c60a6a32d26/microsoft/TypeScript/issues/21598 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9a41e4916b5d0b29e1b67ef25ccab48de2c6b175a7f54032ae810c60a6a32d26/microsoft/TypeScript/issues/21598 |
| og:image:alt | In many programming languages flags are used to encode options via parameters to functions. It provides a way to eliminate the need of multiple option parameters. My suggestion is to have another f... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | exx8 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0366ddfb372682a32e92a5d86155cb08fa83e5bbe79953a968789f2f7e24c511 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ed3f2e01f6b7672780c586c8af0e72726374d7b6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width