|
From: Hemang L. <hl...@ci...> - 2008-11-19 14:14:51
|
Koen Danckaert wrote: > Andreas Kupries wrote: > >> TIP #339: CASE-INSENSITIVE PACKAGE NAMES >> > > >> The package management facilities of Tcl are an area where the user of >> packages is currently burdened with more ... than is convenient or >> easy. A big problem is that Tcl compares package names >> case-sensitively. This means that /Expect/ and /expect/ are two >> different things to Tcl. In the real world however having two packages >> using the same name but different capitalization is extremely rare. >> > > Isn't it so that this "burden" for the user only (or mainly) exists in interactive mode? > No, that's not the only/primary reason. Many of our users are not tcl-savvy and they often show preference to use other lauguages such as perl, python, java, etc. So, in an effort to make it easier for our users (every little bit counts), our developers started introducing hacks in pkgIndex.tcl file to support both styles of package names such as Foo and foo. Users no longer had to worry about the exact case of the package name to use when writing scripts. This approached has worked well for us until we started looking at Tcl Modules and teapot system for package delivery. We now have to start building two TM files for each new package release. Moreover, TIP189 has clearly stated that two packages with different cases are not allowed: ------ Quote from http://www.tcl.tk/cgi-bin/tct/tip/189.html, section "Provide and Index scripts" /Note/ that we are here creating a connection between package names and paths. Tcl is case-sensitive when it comes to comparing package names, but there are filesystems which are not, like NTFS. Luckily these filesystems do store the case of the name, despite not using the information when comparing. Given the above we allow the names for packages in Tcl modules to have mixed-case, but also require that there are no collisions when comparing names in a case-insensitive manner. In other words, if a package 'Foo' is deployed in the form of a Tcl Module, packages like 'foo', 'fOo', etc. are not allowed anymore. ----- Others have also expressed interest in this feature in the past: http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/1192d84e4957e0ae/0d81653d0080142e?lnk=gst&q=package+case+insensitive#0d81653d0080142e I believe that this tip makes it easier for everyone to use during coding, interactive use or teapot use. One downside is that there may be few packages out there (3 for Joe, 1 for our group) which collide with case sensitive package names found in tcllib and those package names may have to be changed. Thanks, Hemang. |