Friday, 15 July 2011

tcl - Is there any way to rename 'set' -


When trying to rename

set function, I got the error too many nested Evaluation (endless loop?) (see below).

Perhaps because renamed uses set inside the internal. Is there any way to override this behavior? Set many nested evaluations (endless loop)

  Set "set CMD [Lindex $ Args 0]" (Process "::" Unknown "), line 8) Set" CMD [Lindyx $ Argos 0] "Process" :: Anonymous "from within line 8" set CMD [Lindex $ Ages 0] "(Process" :: Unknown "line 8) was brought from within ...   

Rename command is an underlying command, TCL, and any other The command is not dependent on the command, however, the interactive evaluation loop uses a slightly set in its history management code, as unknown commands when the name of the command Does not solve the existing command triggers an infinite loop when set is absent, what should the set be present as part of the handling code Stack Protection Code ( See interp recursionlimit ) finally kills things ...

The easiest fix is ​​to make sure that you set some to .

  # replace our replacement proc _set {varName {value} "}} {# This is 8.6-specific code, but you can other_smile_set tailcall {*} [Lrange [info] Level 0] 1 end]} # Swap things in with the two names on the same line ... Rename old_set; Rename replacement_set set  

Note that you do not need to be very careful in the script.


No comments:

Post a Comment