This is something smart contracts really need. Had this been in place during the DAO creation $150,000,000 may not have been stolen. I don't think code can ever be truly 'bug free' but this would make it a damn sight safer.
Quoting Balaji S. Srinivasan<p>"Thesis: the only things you want in a blockchain language are tools to update distributed state. Everything else should be outside."