I am writing a Tcl script that is executed by Cadence Encounter version 14.25 (or 14.20, depending on whether I look at the log file or the splash screen on startup...).
The version of the embedded Tcl interpreter appears to be
% package require Tcl
8.5.9
My script uses the ::tcl::mathfunc::min
function, which, to my understanding, has a variable number of arguments, so for example the following should work (it does in my installation of tclsh
which has version 8.6.4):
% ::tcl::mathfunc::min 1 2 3
1
However, when executed by Encounter, it seems that this is not the case and it only works for exactly two arguments:
% ::tcl::mathfunc::min 1
too few arguments for math function "min"
% ::tcl::mathfunc::min 1 2
1
% ::tcl::mathfunc::min 1 2 3
too many arguments for math function "min"
Why is this so?
- Does the Tcl version reported by Encounter lie?
- Is Encounter's Tcl interpreter broken?
- Does
::tcl::mathfunc::min
only support two arguments in Tcl versions prior to 8.6? All sources that look reliable to me state that it always had a variable number of arguments, for example this, this, or that.
Further investigations triggered by Jackson's answer:
In Encounter:
% info args ::tcl::mathfunc::min
"::tcl::mathfunc::min" isn't a procedure
Great! ...
I discovered there is a min
command in the global scope that has the same behaviour, but different error messages:
% min 1
wrong # args: should be "min x y"
% min 1 2
1
% min 1 2 3
wrong # args: should be "min x y"
Neither of the two (::min
, ::tcl::mathfunc::min
) is contained in the result of interp aliases
.