type value = int;;
type variable = string;;
type environment = (variable * value) list;;

exception Unbound_variable of variable;;

let empty =
  [];;

let bind variable value environment =
  (variable, value) :: environment;;

let rec lookup searched_for_variable environment =
  match environment with
    | [] ->
      raise (Unbound_variable searched_for_variable)
    | (a_variable, a_value) :: rest ->
      if a_variable = searched_for_variable then
        a_value
      else
        lookup searched_for_variable rest;;
