First page Back Continue Last page Overview Image
8.6 Namespaces
[314] namespace ensemble create -parameters
namespace upvar ignores custom resolvers
array, clock, binary, encoding, file, namespace – now ensembles
-parameters Empty by default. Set to specify count and names of parameters which will occur before the ensemble method to dispatch on.
namespace eval intmod {
proc + {n args} {expr {[::tcl::mathop::+ {*}$args] % $n}}
namespace ensemble create -parameters n -subcommands {+}
}
intmod 7 + 4 4
=> 1