The '''identity function''' accepts one value and simply returns that value . ** Reference ** [https://en.wikipedia.org/wiki/Identity_function%|%Identity function] , Wikipedia : ** Description ** [AMG] [PYK]: The identity function is trivial to implement in [Tcl] : ====== proc identity val {return $val} ====== `return -level 0 $x` is the canonical [Tcl commands%|%built-in] identity function . It simply sets the interpreter result to `$x` , and returns to the current level , allowing Tcl to continue processing the sript at the current level . It's an unusual , but often quite useful way to employ `[return]` . Various [Tcl Commands%|%built-in] commands simply return their argument and can also be used as an identity function . === set x {some\{value} #the following all act as identify functions return -level 0 $x lindex $x apply {x {set x}} $x #brace-quoted for safety expr {$x} subst {$x} dict remove $x dict replace $x [K] $x {} [K%|%K*] $x === Let's say you have to pass a script to `[eval]`, and he value `[eval]` returns is used somehow. What script do you pass if you want `[eval]` to simply return a constant, the result of a substitution, or a concatenated combination thereof? All of the above methods work, and `return -level 0` avoids the need for extra quoting or `[proc]` wrappers. An example use on the `[if]` page: ====== set y [if {$x} {lindex a} else {lindex b}] ====== Another approach, on the `[switch]` page, thanks to [RS] (2005-05-30): ====== proc is x {set x} set type [switch -- $num { 1 - 9 {is odd} 2 - 3 - 5 - 7 {is prime} 0 - 4 - 6 - 8 {is even} }] ====== It's possible to delete the `[proc]` line and replace `is` with `[lindex]`. ** See Also ** [I Know Nothing] : more discussion of `-level` [http://core.tcl.tk/tcl/info/1b0266d8bbc649bcb4df5dc4a1edca238536262b%|%Single-argument dict merge/remove/replace] , a Tcl issue : <> Tcl syntax