'''tcl::mathop''' is a Tcl 8.5 [namespace] that contains commands equivalent to the [expr] operators. These commands are all bytecode compiled. Note that changing or adding to these commands does ''not'' change the [expr] operators themselves.
See [Math Operators as Commands] and [tcl::mathfunc]
----
A simple example, because I couldn't immediately work out the incantation to make mathops visible. Note that functions and operators come from different namespaces:
namespace import ::tcl::mathop::*
namespace import ::tcl::mathfunc::*
puts [* [sqrt 49] [+ 1 2 3]]
Alternatively:
namespace path {tcl::mathop tcl::mathfunc}
puts [* [sqrt 49] [+ 1 2 3]]
There are better examples of the use of mathop scattered through the wiki; somebody should add links to some of the ones less obvious to non-lispers!
----
[RS] 2008-09-17: Should you only want to import the [*] multiplication operator, escape it with backslash, to distinguish from "*" meaning "all":
% namespace import tcl::mathop::\\*
% + 2 3
invalid command name "+"
% * 2 3
6
-----
!!!!!!
%|[Category Command]|[Category Syntax]|[Category Mathematics]|%
!!!!!!