The tutorial needs to be even clearer about the process of creating packages. As evidence, here's a chunk of log from the Tcler's Chat:
[11:27]<daedra>hi there, I'm wrestling with creating a package
[11:28]<daedra>I have some code very similar to tutstack in http://www.tcl.tk/man/tcl/tutorial/Tcl31.html
[11:28]dkfStep 1: write the code
[11:29]dkfStep 2: make the package index file, either with pkg_mkIndex or manually (it's not too hard once you see what the file contains )
[11:29]dkfStep 3: put the directory containing the code and the index file somewhere where Tcl will find it
[11:30]dkf(either by adjusting your auto_path or by putting it somewhere which is searched by default )
[11:30]dkfthat's about all there is
[11:31]<daedra>but instead of defining lots of procs prefixed with :: (e.g. ::tutstack), I just wrap everything in a name space
[11:31]dkf(If you make a Tcl Module, apparently Step 2 becomes "save the file with the right filename")
[11:31]<daedra>I suppose I should make it as similar as possible
[11:31]<daedra>oh so you need a pkgIndex file?!
[11:31]<daedra>but the tutorial doesn't menton one in the example
[11:31]dkfIt does, higher up
[11:31]dkfUnder "Creating a package"
[11:31]dkfa bulleted list
[11:32]dkfAnd it's pretty much what I said
[11:32]<daedra>o
[11:32]dkf
[11:32]<daedra>ok
[11:32]<daedra>full marks
[11:35]dkfPerhaps we need to improve the tutorial
[11:36]dkfyou missed a critical step, therefore it is not good enough
|