mixed solution: unicase (unique allowed case) (was: Re: Case-sensitivity: )
Florian Weimer
fw at deneb.cygnus.argh.org
Fri Jun 2 16:51:50 EDT 2000
Johannes Nix <Johannes.Nix at mail.uni-oldenburg.de> writes:
> why don't turn it this way to get advantages of both alternatives:
>
> - the language is case sensitive.
>
> - an assignment to the same name with different case in the same
> module is a Case Error exception.
This idea is not new. GNAT (GNU Ada Translator), for example,
implements it. Although Ada is case-insensitive, there's a compiler
switch which enforces casing which matches the style used in the
declaration of an entity. Code which compiles even though this switch
is turned on certainly looks cleaner.
> But you would _not_ allow any programmer to distinguish names only by
> case (which in my eyes is not the best style, and most probably a
> mistake which leads to a name error anyway). A small percentage of
> code would have to be fixed up. (And this could be done
> automatically).
There's the convention to use "Foo" for classes and "foo" for
instances. I don't think people want to give up that.
More information about the Python-list
mailing list