Tcl
foreach x [info commands] {if {$x!="rename"&&$x!="if"} {rename $x ""}}
This removes all keywords from the language except if
and rename
.
The above code would cause any new code to error out. So it's debatable if the new inserted code actually gets "executed". Below is a version that executes new code but does nothing because it changes all keywords (except if
and renameproc
) to a no-operation):
foreach x [info commands] {if {$x!="if"&&$x!="proc"} {
proc $x args {}
}}
Instead of deleting keywords this code replaces them with a function that does nothing.
Note: (I'mNote: I'm using "keywords" very loosely here because Tcl doesn't have keywords, only functions)