Version 4 of overload

Updated 2005-12-27 02:37:17

[General meaning in software]

[much used in Tcl]

In Tcl, to enhance a core command by renaming the core command to be enhanced, then creating a procedure with the same name as the core command, adding the desired functionality.

Easy example, provided by RS:

    rename exit _exit

    proc exit {{code 0}} {
        set fp [open test a]
        puts $fp "trapped exit at [clock format [clock seconds]]"
        _exit $code
    }

[General case needs uplevel ...]


Category Development