Is this function pure?
int probablyNotPure(int x)
{
try
{
char[] a = new char[x];
return a.length;
}
catch
{
return 0;
}
}
I must assume not, since it's not deterministic. But which part of it
wrong? Should "new" be forbidden? Or is "try/catch"? Or both?