From: Lars H. <Lar...@re...> - 2010-04-12 17:08:36
|
Looking into tm.tcl, I've encountered two features which seem to be documented neither in the tm.n manpage nor in the Tcl module TIPs. In the manpage, it says: For a module file *MF* the /index script/ is always: package ifneeded *PNAME PVERSION* [list source *MF*] But looking in the actual definition of ::tcl::tm::UnknownHandler, one finds it is rather: package ifneeded $pkgname $pkgversion \ "[::list package provide $pkgname $pkgversion];[::list source -encoding utf-8 $file]" I.e., 1. Tcl Modules don't have to contain a [package provide], and 2. the encoding is always utf-8 (rather than [encoding system], as an unqualified [source] would imply). Both seem like Good Ideas to me, but when were they decided (and why aren't they in the docs)? For example http://wiki.tcl.tk/25702 (even if that could be regarded as not so good advice) would have been much simpler, had the original contributor known that the [package provide] was unnecessary. Lars Hellström |