-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Cleanup #14777
Cleanup #14777
Conversation
/cc @Araq I've reviewed everything, looks excellent! feel free to review but I've already done a thorough pass and LGTM (modulo remaining comments) so feel free to skip this one if you want to save time.
|
|
Assignments like ' result = "" ' will become mandatory, we really want definite assignment analysis like C#, so don't remove them. And sorry but I also don't like that you removed my lookup tables. |
until something like that happens, it doesn't make sense to have assignments in a some parts of the code code and not in others parts (other parts of stdlib, or, more importantly, all the third party code ever written that relies on
tkIf => if is more than just for debugging, it's the canonical string used in parser, error messages etc. In fact we only use the canonical form for those enums ( What we can add (and I can volunteer an implementation) is a way to get the native string for an enum: type Foo = enum
f1 = "myF1"
f2 = "myF2"
import std/typetraits
const f = f1
static: doAssert $f == "myF1"
static: doAssert f.nativeStr == "f1" |
Well the warning already exists and I'll enable it for the compiler. And I've already begun to patch the stdlib. Since the warning already exists, it doesn't need an RFC process for the time being, the compiler's codebase can diverge from the historical default settings. I don't like the |
starting from first principles, a DRY solution is better. It doesn't have to be
"enum with holes" in the title was just contextual, it's really not specific to enum with holes if you follow that PR; it's really about providing "enum map" with the simplest possible syntax and minimal overhead. |
Yeah, that's a nice compromise. Bring it on please! |
done, I suggest putting this PR on temporary hold pending #14008 |
ea93075
to
9f4625b
Compare
0b86029
to
9c19eb7
Compare
9c19eb7
to
99b557b
Compare
Regarding comment identation
I think the module compiler/forloops is also dead code, or at least I can't find it used anywhere, so you may want to delete it in this PR? |
No description provided.