An agreement to be an enforceable contract must contemplate the attainment of an object not expressly forbidden by law nor contrary to public policy. For example: An agreement for the sale of realty to be used expressly for the sale of alcoholic beverages is unenforceable as its object is contrary to law. So also an agreement by which A, a confirmed woman hater, promises B a house for B's promise never to marry, is against public policy, as discouraging marriage, and therefore unenforceable.