I certainly won't contradict anything written so far, as it all seems sourced and very well known by the responders.
I will add *this* though. An eye for an eye was actually a more/tenet/commandment/principal about punitive *restraint*. That, as far as the legal system (or church) should be concerned, an eye for an eye is an admonishment NOT to punish MORE severly than the crime/misdeed warrants.
In short it means An eye for an eye. You don't get to take both eyes from s/he who robbed you of one. That's called revenge.