MATLAB
The following piece of code makes the environment completely unusable1:
builtin = @(varargin)false; clear = @(varargin)false;
%// Insert code after this point
This overrides the builtin
function and the clear
function with new anonymous function handles that simply return false
every time you try and call these functions. The builtin
function ensures that if there are any custom functions you write in MATLAB that are the same name as those that are built-in to MATLAB (things like sum
, max
, min
, etc.), you are able to call these unambiguously instead of the overloaded functions. Similarly, clear
gives you the ability to clear all variables that are currently declared so you can start anew. By removing these capabilities, there is no way that you can use MATLAB unless you restart the program.
In MATLAB R2015a, I also get the following message:
The Workspace are the variables that are currently declared in the environment so that you can use them for later. This permanently disables the Workspace, so any variables you try and create will not be saved and hence no progress can be made when executing lines of code in MATLAB.
1: Credit goes to user Dev-iLDev-iL who originally discovered the idea.