TypeScript's @chronicles.org is pitching enum in JS 🎉
It's the good parts of TS enum + enhancements:
🔶 More datatypes: Symbols etc
🔶 Iterable
🔶 Immutable
🔶 Null prototype
🔶 No declaration merging
🔶 Compatible with Node type-stripping 👍
github.com/rbuckton/pro...
TypeScript's @chronicles.org is pitching enum in JS 🎉
It's the good parts of TS enum + enhancements:
🔶 More datatypes: Symbols etc
🔶 Iterable
🔶 Immutable
🔶 Null prototype
🔶 No declaration merging
🔶 Compatible with Node type-stripping 👍
github.com/rbuckton/pro...
➡️NO,
➡️YES,
➡️FILE_NOT_FOUND
}
➡️NO,
➡️YES,
➡️FILE_NOT_FOUND
}
"here, I have helpfully given you a unit test for all possible enum values" (good)
"I have also hallucinated some extra enum values in case you wanted to test those too" (hold on a second)
verdict remains: use with heavy supervision
"here, I have helpfully given you a unit test for all possible enum values" (good)
"I have also hallucinated some extra enum values in case you wanted to test those too" (hold on a second)
verdict remains: use with heavy supervision
#csharp #gamedev #indiedev #gamedevelopment
#csharp #gamedev #indiedev #gamedevelopment
{
e_NO = 0,
e_YES = 1,
e_NoYesMax
} t_NoYesEnum;
{
e_NO = 0,
e_YES = 1,
e_NoYesMax
} t_NoYesEnum;
Congrats to @chronicles.org on advancing the Enum proposal to Stage 1 at TC39 today 🎉
This aims to bring the good parts of TypeScript enums to JavaScript plus enhancements such as new datatypes & potentially runtime performance improvements 👍
github.com/tc39/proposa...
Congrats to @chronicles.org on advancing the Enum proposal to Stage 1 at TC39 today 🎉
This aims to bring the good parts of TypeScript enums to JavaScript plus enhancements such as new datatypes & potentially runtime performance improvements 👍
github.com/tc39/proposa...
or is this too much of an out there explanation?
or is this too much of an out there explanation?
devblogs.microsoft.com/typescript/t...
Today is your lucky day: https://hexdocs.pm/elixir/main/enum-cheat.html
Today is your lucky day: https://hexdocs.pm/elixir/main/enum-cheat.html
Kept them as raw strings instead of an enum, so I can do weird special-cases later 🫠
Toy example:
“Mirror Shade challenges you! You’re ready for yourself!” 🥰
#gamedev #indiedev #programming #unity
Kept them as raw strings instead of an enum, so I can do weird special-cases later 🫠
Toy example:
“Mirror Shade challenges you! You’re ready for yourself!” 🥰
#gamedev #indiedev #programming #unity
gender is: a boolean, 0, 1, 2, "none", "limited", "full", "line-tables-only", or "line-directives-only"
we should be allowed to use primitive-repr enum variants as const generic parameters instead of having to put them in traits. a u16 enum with a catch-all is as const as a u16, right?
we should be allowed to use primitive-repr enum variants as const generic parameters instead of having to put them in traits. a u16 enum with a catch-all is as const as a u16, right?