If we're going towards this way of defining things (which is fine by me), then I would prefer for the lookup (mapping and rev_mapping) to use Hashtbl's iso association lists.