So we can name our modules whatever we want, and use other's according to our preference as well because module names are the only symbols which shouldn't (and can't, due to Windows)
Actually Windows is case preserving, so you can treat it like Poonix. I'm not saying it's a good idea.
I think it would be a good idea to make all modules normalize to lowercase when the compiler search for the file, but allow the module itself to define the symbol via import, eg:
Seems rather hard to implement for very little gain. All lower case plus sometimes underscores (db_sqlite) is the default for module names and I see no reason to change that.
How 'case-sensitive' would symbols be in this case?
Very. You need to run nimrod pretty over pretty much everything. It's a huge breaking change. Note however that this is a problem no matter how we end up defining the normalization rules of --cs:partial.
Also, currently I am using PascalCase on my modules, and I always will want to.
Fine with me but your fight for ultimate consistency would be much more convincing when you would stick to the existing convention... This "I want consistency everywhere, but it has to be my style" is getting absurd. You make me re-consider leaving --cs:none the default...
EDIT: Ok, now I understand your reasoning behind this. But isn't the conflation of types with module names confusing for others? ;-) :P
But isn't the conflation of types with module names confusing for others?
No it's not confusing at all, my 'instance' (run-time memory) names are always camelCase and my 'constant' (static reference points such as modules, types, enums, & possibly const) names are always caps... but that's just my preference and my original point was specifically about letting people choose preference here. I'm not saying we should change to my preference in any way.. I'm not sure where you got that.
Also, i'm not sure what you think would be hard about implementing this. Technically it's already done, eg: import opengl as OpenGL My idea is just to mimic that behavior implicitly once we change to --cs:partial so that module names aren't subject to full case sensitivity (btw, it's not just me, I remember reading a reddit comment with someone asking why module names were all lowercase, and i'm sure many devs with Java/C# backgrounds might prefer it).
Again though, I'm not asking you to do the work here, only bringing this up as a natural part of the discussion about case-sensitivity in general. I will do the work for it, and in the meantime you can just import using the exact filenames.
Fair enough and btw the compiler already implements the rule "did not find the filename, try all lowercase".
But there might be a problem when you don't do the imports consistently: import opengl and then in some other module import OpenGL might end up loading the module twice since with --cs:partial OpenGL != opengl. And having per-symbol kind case sensitivity rules can't work.
...might end up loading the module twice...
My idea was to normalize (lowercase) the import name, and implicitly add the 'as ...' part with the un-normalized symbol (unless an as expr is already present, in which case it just uses that). Then just normalize the file-name lookup as well (so import foo would still find FOO.nim). I don't think there would be any duplicated imports unless that's what currently happens when you import opengl as OpenGL.
[EDIT] by "normalize the filename lookup" i mean "do an case-insensitive file lookup".
Is it possible to make types syntactically distinct from expression symbols without too much pain?
Update: Well, I guess I missed Araq's comment that he's against syntactic disambiguation. My bad. So never mind.
would either (or both) of them remove the need to include the "c*" prefixes on some of the symbols in the OpenGL module (e.g. cGL_ACCUM to distinguish it from the procedure glAccum)?
Yes. Currently compiling code with --cs:partial means capitalization of the first character (only) matters, eg, bar is different than Bar but not bAR. This fixes most ambiguity issues of full case-insensitivity, but retains the majority of it's benefits, and I personally love it.
NOTE: currently there are a few remaining capitalization errors which prevent you from using OpenGL, X11, and DynLib with --cs:partial. I've submitted some PRs recently which will correct those.
Yes. Currently compiling code with --cs:partial means capitalization of the first character (only) matters, eg, bar is different than Bar but not bAR. This fixes most ambiguity issues of full case-insensitivity, but retains the majority of it's benefits, and I personally love it.
Thanks for explaining this. This sounds like a great step forward!