From 23603d8c3d482a9f92a949c9da1c71a0c8e68343 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Mon, 13 Feb 2023 10:55:58 +1000 Subject: docs: document ensemble and namespace ensemble create Signed-off-by: Steve Bennett --- jim_tcl.txt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/jim_tcl.txt b/jim_tcl.txt index fe432e0..af232c5 100644 --- a/jim_tcl.txt +++ b/jim_tcl.txt @@ -62,6 +62,7 @@ Changes between 0.81 and 0.82 6. `vwait -signal` is now supported 7. ./configure now defaults to '--full' 8. New `timerate` command as an improvement over `time`, somewhat compatible with TIP 527 +9. Add `ensemble` command and support for `namespace ensemble` (as an optional extension) Changes between 0.80 and 0.81 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2169,6 +2170,25 @@ command. The legal +'options'+ are: +*dict for, values, incr, append, lappend, update, info, replace*+ to be documented... +ensemble +~~~~~~~~ ++*ensemble* 'name ?*-automap*? prefix'+ + +Create a single ensemble command that redirects to individual commands based on the prefix. +By default, the prefix is +'name'+ followed by a single space. + +For example, consider: + + proc {test open} {name} { ... } + proc {test close} {handle} { ... } + proc {test show} {handle} { ... } + ensemble test + +Now the '+test+' command has been created that redirects based on the first argument. +e.g. + + test open $filename => {test open} $filename + env ~~~ +*env* '?name? ?default?'+ @@ -5552,6 +5572,9 @@ Provides namespace-related functions. See also: http://www.tcl.tk/man/tcl8.6/Tcl +*namespace delete* '?namespace ...?'+:: Deletes all commands and variables with the given namespace prefixes. ++*namespace ensemble create*'+:: + Creates an ensemble command for the current namespace (requires the 'ensemble' extension'). + +*namespace eval* 'namespace arg ?arg...?'+:: Activates a namespace called +'namespace'+ and evaluates some code in that context. -- cgit v1.1