Menu

#4886 insufficient clarity in Tutorial 31

open
5
2011-08-08
2011-08-08
No

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] dkf Step 1: write the code
[11:29] dkf Step 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] dkf Step 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] dkf that'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] dkf It does, higher up
[11:31] dkf Under "Creating a package"
[11:31] dkf a bulleted list
[11:32] dkf And 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] dkf Perhaps we need to improve the tutorial
[11:36] dkf you missed a critical step, therefore it is not good enough

Discussion