#4462 expr min and max don't work in a safe interp

obsolete: 8.5.7

::tcl::mathfunc::min and ::tcl::mathfunc::max are not created in a safe interp

this both commands are procs, written in pure tcl [info procs ::tcl::mathfunc::*]

To avoid this, create aliases for this method, but I think, this soud be created as well (like sin and cos and so on)


  • Donal K. Fellows

    • priority: 5 --> 8
  • Don Porter

    Don Porter - 2009-11-11

    This is a consequence of Tcl_Init() not
    being called on safe interps. I was surprised
    to see that. I'll want to restore my understanding
    of the history before leaping on this change,
    even though the requested end if clearly correct.

  • Anonymous

    Anonymous - 2009-11-11

    Of course. On the other hand even a safe interp can create this commands on his own.

    My suggest is to split Tcl_Init() into 2 or 3 parts, one for safe, one fore normal unsafe, and eventually a common init.

  • Donal K. Fellows

    • assigned_to: hobbs --> dgp
  • Donal K. Fellows

    That's a bit complex because most of what Tcl_Init is doing is arranging for paths to be set correctly (very nasty!) and for init.tcl to be sourced (which does many things, including defining min() and max() of course).

  • Don Porter

    Don Porter - 2009-12-09
    • priority: 8 --> 9
  • Donal K. Fellows

    Made both max() and min() work in safe interpreters. There's still the reconsideration of just what is to be done when building a safe interpreter, but that's now a less pressing problem so the priority is dropped a bit.

  • Donal K. Fellows

    • priority: 9 --> 8