Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

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

obsolete: 8.5.7
open
Don Porter
8
2009-12-29
2009-11-11
Johannes13
No

::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)

Discussion

    • 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.

     
  • Johannes13
    Johannes13
    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.

     
    • assigned_to: hobbs --> dgp
     
  • 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
     
  • 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.

     
    • priority: 9 --> 8