Tcl

TCL - package tutorial
Login

Home

This directory contains a Tcl package tutorial.
The goal is to create the fnest package.

Create a basic single-file package from scratch

The following Bash script creates a subdirectory containing a basic Tcl package, and a Tcl caller script, which uses the package.

./pkg-creator.sh

Create a multi-file package from scratch

TODO.

Packages, namespaces and ensembles

TODO.

Links

Ideas to structure a Tcl package split into several files:

Fossil's own code:

NOTE: Other (imported) source code files in the same directory use another naming convention, so focus on these ones:

package ifneeded vc::tools::dot                             1.0 [list source [file join $dir dot.tcl]]
package ifneeded vc::tools::id                              1.0 [list source [file join $dir id.tcl]]
package ifneeded vc::tools::log                             1.0 [list source [file join $dir log.tcl]]
package ifneeded vc::tools::misc                            1.0 [list source [file join $dir misc.tcl]]
package ifneeded vc::tools::mem                             1.0 [list source [file join $dir mem.tcl]]
package ifneeded vc::tools::trouble                         1.0 [list source [file join $dir trouble.tcl]]