Tcl Library Source Code


[ Main Table Of Contents | Table Of Contents | Keyword Index | Categories | Modules | Applications ]


tool - TclOO Library (TOOL) Framework

Table Of Contents


package require Tcl 8.6 9
package require sha1
package require dicttool
package require oo::meta
package require oo::dialect

tool::define class_method arglist body
tool::define array name contents
tool::define array_ensemble methodname varname ?cases?
tool::define dict_ensemble methodname varname ?cases?
tool::define method methodname arglist body
tool::define option name dictopts
tool::define property ?branch? field value
tool::define variable name value
object cget option
object configure ?keyvaluelist?
object configure field value ?field? ?value? ?...?
object configurelist ?keyvaluelist?
object forward stub forward
object graft stub forward
object InitializePublic
object Eval_Script ?script?
object Option_Default field


This module implements the Tcl Object Oriented Library framework, or TOOL. It is intended to be a general purpose framework that is useable in its own right, and easily extensible.

TOOL defines a metaclass with provides several additional keywords to the TclOO description langauge, default behaviors for its consituent objects, and top-down integration with the capabilities provided by the oo::meta package.

The TOOL metaclass was build with the oo::dialect package, and thus can be used as the basis for additional metaclasses. As a metaclass, TOOL has it's own "class" class, "object" class, and define namespace.

package require tool

# tool::class workds just like oo::class
tool::class create myclass {

# tool::define works just like oo::define
tool::define myclass method noop {} {}

# tool::define and tool::class understand additional keywords
tool::define myclass array_ensemble mysettings mysettings {}

# And tool interoperates with oo::define
oo::define myclass method do_something {} { return something }

# TOOL and TclOO objects are interchangeable
oo::class create myooclass {
  superclass myclass

Several manual pages go into more detail about specific keywords and methods.


TOOL adds new (or modifies) keywords used in the definitions of classes. However, the new keywords are only available via calls to tool::class create or tool::define

Public Object Methods

The TOOL object mother of all classes defines several methods to enforces consistent behavior throughout the framework.

Private Object Methods


Sean Woods

Bugs, Ideas, Feedback

This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category tcloo of the Tcllib Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.

When proposing code changes, please provide unified diffs, i.e the output of diff -u.

Note further that attachments are strongly preferred over inlined patches. Attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar.


TOOL, TclOO, framework




Copyright © 2015 Sean Woods